def insert_color(self, target_color, convert=None, picker=False, alpha=False):
        """Insert colors."""

        sels = self.view.sel()
        if (len(sels) == 1 and sels[0].size() == 0):
            point = sels[0].begin()
            parts = target_color.split('@')
            target_color = parts[0]
            dlevel = len(parts[1]) if len(parts) > 1 else 3
            if not picker:
                rules = util.get_rules(self.view)
                use_hex_argb = rules.get("use_hex_argb", False) if rules else False
                allowed_colors = rules.get('allowed_colors', []) if rules else util.ALL
                compress_hex = rules.get('compress_hex_output', False) if rules else False
                calc = InsertCalc(self.view, point, target_color, convert, allowed_colors, use_hex_argb)
                calc.calc()
                if alpha:
                    calc.alpha_hex = target_color[-2:]
                    calc.alpha = util.fmt_float(float(int(calc.alpha_hex, 16)) / 255.0, dlevel)
                if calc.web_color and not calc.alpha:
                    value = calc.web_color
                elif calc.convert_rgb:
                    value = "%d, %d, %d" % (
                        int(calc.color[1:3], 16),
                        int(calc.color[3:5], 16),
                        int(calc.color[5:7], 16)
                    )
                    if calc.alpha:
                        value += ', %s' % calc.alpha
                    value = ("rgba(%s)" if calc.alpha else "rgb(%s)") % value
                elif calc.convert_gray:
                    value = "%d" % int(calc.color[1:3], 16)
                    if calc.alpha:
                        value += ', %s' % calc.alpha
                    value = "gray(%s)" % value
                elif calc.convert_hsl:
                    hsl = RGBA(calc.color)
                    h, l, s = hsl.tohls()
                    value = "%s, %s%%, %s%%" % (
                        util.fmt_float(h * 360.0),
                        util.fmt_float(s * 100.0),
                        util.fmt_float(l * 100.0)
                    )
                    if calc.alpha:
                        value += ', %s' % calc.alpha
                    value = value % ("hsla(%s)" if calc.alpha else "hsl(%s)")
                elif calc.convert_hwb:
                    hwb = RGBA(calc.color)
                    h, w, b = hwb.tohwb()
                    value = "%s, %s%%, %s%%" % (
                        util.fmt_float(h * 360.0),
                        util.fmt_float(w * 100.0),
                        util.fmt_float(b * 100.0)
                    )
                    if calc.alpha:
                        value += ', %s' % calc.alpha
                    value = "hwb(%s)" % value
                else:
                    use_upper = ch_settings.get("upper_case_hex", False)
                    color = calc.color
                    if calc.alpha_hex:
                        if convert == 'ahex':
                            color = '#' + calc.alpha_hex + calc.color[1:]
                        else:
                            color = calc.color + calc.alpha_hex
                    if compress_hex:
                        color = util.compress_hex(color)
                    value = color.upper() if use_upper else color.lower()
            else:
                rules = util.get_rules(self.view)
                allowed_colors = rules.get('allowed_colors', []) if rules else util.ALL
                calc = PickerInsertCalc(self.view, point, allowed_colors)
                calc.calc()
                value = target_color
            self.view.sel().subtract(sels[0])
            self.view.sel().add(calc.region)
            self.view.run_command("insert", {"characters": value})
        self.view.hide_popup()
dataset/ETHPy150Open facelessuser/ColorHelper/color_helper.py/ColorHelperCommand.insert_color/swapped operands of `%`