def index_colors(self):
        """Index colors in file."""

        colors = set()
        for m in util.COLOR_RE.finditer(self.source):
            if self.abort:
                break
            if m.group('hex_compressed') and not self.color_okay('hex_compressed'):
                continue
            elif m.group('hexa_compressed') and not self.color_okay('hexa_compressed'):
                continue
            elif m.group('hex') and not self.color_okay('hex'):
                continue
            elif m.group('hexa') and not self.color_okay('hexa'):
                continue
            elif m.group('rgb') and not self.color_okay('rgb'):
                continue
            elif m.group('rgba') and not self.color_okay('rgba'):
                continue
            elif m.group('gray') and not self.color_okay('gray'):
                continue
            elif m.group('graya') and not self.color_okay('graya'):
                continue
            elif m.group('hsl') and not self.color_okay('hsl'):
                continue
            elif m.group('hsla') and not self.color_okay('hsla'):
                continue
            elif m.group('hwb') and not self.color_okay('hwb'):
                continue
            elif m.group('hwba') and not self.color_okay('hwba'):
                continue
            color, alpha, alpha_dec = util.translate_color(m, self.use_hex_argb)
            color += alpha if alpha is not None else 'ff'
            if not color.lower().endswith('ff'):
                parts = alpha_dec.split('.')
                dlevel = len(parts[1]) if len(parts) > 1 else None
                if dlevel is not None:
                    color += '@%d' % dlevel
            colors.add(color)
        if self.color_okay('webcolors'):
            for m in self.webcolor_names.finditer(self.source):
                if self.abort:
                    break
                colors.add(csscolors.name2hex(m.group(0)))
        if not self.abort:
            sublime.set_timeout(
                lambda view=self.view, colors=list(colors): self.update_index(view, colors), 0
            )
dataset/ETHPy150Open facelessuser/ColorHelper/color_helper.py/ChFileIndexThread.index_colors/original