def show_insert(self, color, palette_type, palette_name, update=False):
        """Show insert panel."""

        sels = self.view.sel()
        if (len(sels) == 1 and sels[0].size() == 0):
            parts = color.split('@')
            dlevel = len(parts[1]) if len(parts) > 1 else 3
            point = sels[0].begin()
            rules = util.get_rules(self.view)
            use_hex_argb = rules.get("use_hex_argb", False) if rules else None
            allowed_colors = rules.get('allowed_colors', []) if rules else util.ALL
            calc = InsertCalc(self.view, point, parts[0], 'rgba', allowed_colors, bool(use_hex_argb))
            found = calc.calc()

            rules = util.get_rules(self.view)
            allowed_colors = rules.get('allowed_colors', []) if rules else util.ALL

            secondry_alpha = found and calc.alpha is not None and calc.alpha != '1'

            txt = [
                BACK_COLORS_MENU % (palette_type, palette_name),
                '\n## Insert Color\n'
            ]
            rgba = RGBA(parts[0])
            alpha = util.fmt_float(float(rgba.a) / 255.0, dlevel)

            try:
                web_color = csscolors.hex2name(rgba.get_rgb())
            except Exception:
                web_color = None

            if web_color and "webcolors" in allowed_colors:
                txt.append(WEB_COLOR % (rgba.get_rgb(), web_color))
            if "hex" in allowed_colors:
                txt.append(HEX_COLOR % (rgba.get_rgb(), rgba.get_rgb()))
            if "hexa" in allowed_colors:
                if use_hex_argb is None or use_hex_argb is False:
                    txt.append(HEXA_COLOR_ALPHA % (rgba.get_rgba(), rgba.get_rgb(), rgba.get_rgba()[-2:]))
                if use_hex_argb is None or use_hex_argb is True:
                    txt.append(AHEX_COLOR_ALPHA % (rgba.get_rgba(), '#', rgba.get_rgba()[-2:], rgba.get_rgb()[1:]))
            if "rgb" in allowed_colors:
                txt.append(RGB_COLOR % (rgba.get_rgb(), rgba.r, rgba.g, rgba.b))
            if "rgba" in allowed_colors:
                txt.append(RGBA_COLOR_ALPHA % (rgba.get_rgba() + ("@%d" % dlevel), rgba.r, rgba.g, rgba.b, alpha))
            if "gray" in allowed_colors and util.is_gray(rgba.get_rgb()):
                txt.append(GRAY_COLOR % (rgba.get_rgb(), rgba.r))
            if "graya" in allowed_colors and util.is_gray(rgba.get_rgb()):
                txt.append(GRAYA_COLOR_ALPHA % (rgba.get_rgba() + ("@%d" % dlevel), rgba.r, alpha))
            h, l, s = rgba.tohls()
            if "hsl" in allowed_colors:
                txt.append(
                    HSL_COLOR % (
                        rgba.get_rgb(),
                        util.fmt_float(h * 360.0), util.fmt_float(s * 100.0), util.fmt_float(l * 100.0)
                    )
                )
            if "hsla" in allowed_colors:
                txt.append(
                    HSLA_COLOR_ALPHA % (
                        rgba.get_rgba() + ("@%d" % dlevel),
                        util.fmt_float(h * 360.0), util.fmt_float(s * 100.0), util.fmt_float(l * 100.0),
                        alpha
                    )
                )
            h, w, b = rgba.tohwb()
            if "hwb" in allowed_colors:
                txt.append(
                    HWB_COLOR % (
                        rgba.get_rgb(),
                        util.fmt_float(h * 360.0), util.fmt_float(w * 100.0), util.fmt_float(b * 100.0)
                    )
                )
            if "hwba" in allowed_colors:
                txt.append(
                    HWBA_COLOR_ALPHA % (
                        rgba.get_rgba() + ("@%d" % dlevel),
                        util.fmt_float(h * 360.0), util.fmt_float(w * 100.0), util.fmt_float(b * 100.0),
                        alpha
                    )
                )

            if secondry_alpha:
                txt.append('\n\n---\n\n## Use Selected Alpha\n')
                if "hexa" in allowed_colors:
                    if use_hex_argb is None or use_hex_argb is False:
                        txt.append(HEXA_COLOR % (rgba.get_rgb(), rgba.get_rgb(), calc.alpha_hex))
                    if use_hex_argb is None or use_hex_argb is True:
                        txt.append(AHEX_COLOR % (rgba.get_rgb(), '#', calc.alpha_hex, rgba.get_rgb()[1:]))
                if "rgba" in allowed_colors:
                    txt.append(
                        RGBA_COLOR % (
                            rgba.get_rgb(),
                            rgba.r, rgba.g, rgba.b, calc.alpha
                        )
                    )
                if allowed_colors in "graya" and util.is_gray(rgba.get_rgb()):
                    txt.append(GRAYA_COLOR % (rgba.get_rgb(), rgba.r, calc.alpha))
                if "hsl" in allowed_colors:
                    txt.append(
                        HSLA_COLOR % (
                            rgba.get_rgb(),
                            util.fmt_float(h * 360.0), util.fmt_float(s * 100.0), util.fmt_float(l * 100.0),
                            calc.alpha
                        )
                    )
                if "hwb" in allowed_colors:
                    txt.append(
                        HWBA_COLOR % (
                            rgba.get_rgb(),
                            util.fmt_float(h * 360.0), util.fmt_float(w * 100.0), util.fmt_float(b * 100.0),
                            calc.alpha
                        )
                    )

            if update:
                md = mdpopups.md2html(self.view, ''.join(txt))
                mdpopups.update_popup(
                    self.view,
                    '<div class="color-helper content">%s</div>' % md,
                    css=util.ADD_CSS
                )
            else:
                self.view.settings().set('color_helper.popup_active', True)
                self.view.settings().set('color_helper.popup_auto', self.auto)
                md = mdpopups.md2html(self.view, ''.join(txt))
                mdpopups.show_popup(
                    self.view, '<div class="color-helper content">%s</div>' % md,
                    css=util.ADD_CSS, location=-1, max_width=600, max_height=350,
                    on_navigate=self.on_navigate,
                    on_hide=self.on_hide,
                    flags=sublime.COOPERATE_WITH_AUTO_COMPLETE
                )
dataset/ETHPy150Open facelessuser/ColorHelper/color_helper.py/ColorHelperCommand.show_insert/swapped operands of `in`