def format_info(self, color, alpha=None):
        """Format the selected color info."""
        rgba = RGBA(color)

        rules = util.get_rules(self.view)
        allowed_colors = rules.get('allowed_colors', []) if rules else util.ALL
        use_hex_argb = rules.get("use_hex_argb", False) if rules else None
        if alpha is not None:
            parts = alpha.split('.')
            dlevel = len(parts[1]) if len(parts) > 1 else None
            alpha_hex = alpha_hex_display = "%02x" % (util.round_int(float(alpha) * 255.0) & 0xFF)
            if dlevel is not None:
                alpha_hex += '@%d' % dlevel
        else:
            alpha_hex = ''

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

        s = sublime.load_settings('color_helper.sublime-settings')
        show_global_palettes = s.get('enable_global_user_palettes', True)
        show_project_palettes = s.get('enable_project_user_palettes', True)
        show_favorite_palette = s.get('enable_favorite_palette', True)
        show_current_palette = s.get('enable_current_file_palette', True)
        show_conversions = s.get('enable_color_conversions', True)
        show_picker = s.get('enable_color_picker', True)
        palettes_enabled = (
            show_global_palettes or show_project_palettes or
            show_favorite_palette or show_current_palette
        )
        click_color_box_to_pick = s.get('click_color_box_to_pick', 'none')

        if click_color_box_to_pick == 'color_picker' and show_picker:
            color_box_wrapper = '\n\n[%s]' + ('(__color_picker__:%s)' % color)
        elif click_color_box_to_pick == 'palette_picker' and palettes_enabled:
            color_box_wrapper = '\n\n[%s](__palettes__)'
        else:
            color_box_wrapper = '\n\n%s'

        info = []

        if click_color_box_to_pick != 'palette_picker' and palettes_enabled:
            info.append(PALETTE_MENU)
        if click_color_box_to_pick != 'color_picker' and show_picker:
            info.append(PICK_MENU % color)
        if show_global_palettes or show_project_palettes:
            info.append(ADD_COLOR_MENU % color.lower())
        if show_favorite_palette:
            if (color.lower() + alpha_hex) in util.get_favs()['colors']:
                info.append(UNMARK_MENU % (color.lower() + alpha_hex))
            else:
                info.append(MARK_MENU % (color.lower() + alpha_hex))

        no_alpha_color = color[:-2] if len(color) > 7 else color
        info.append(
            color_box_wrapper % mdpopups.color_box(
                [no_alpha_color, color], '#cccccc', '#333333',
                height=self.preview_h, width=self.preview_w, border_size=2
            )
        )

        if show_conversions:
            info.append('\n\n---\n\n')
            if web_color and 'webcolors' in allowed_colors:
                info.append(WEB_COLOR % (color, web_color))
            if "hex" in allowed_colors:
                info.append(HEX_COLOR % (color, (color.lower() if not alpha else color[:-2].lower())))
            if allowed_colors in "hexa":
                if use_hex_argb is None or use_hex_argb is False:
                    info.append(HEXA_COLOR % (
                        color, rgba.get_rgb().lower(), ('ff' if not alpha else alpha_hex_display))
                    )
                elif use_hex_argb is None or use_hex_argb is True:
                    info.append(AHEX_COLOR % (
                        color, '#', ('ff' if not alpha else alpha_hex_display), rgba.get_rgb().lower()[1:])
                    )
            if "rgb" in allowed_colors:
                info.append(RGB_COLOR % (color, rgba.r, rgba.g, rgba.b))
            if "rgba" in allowed_colors:
                info.append(RGBA_COLOR % (color, rgba.r, rgba.g, rgba.b, alpha if alpha else '1'))
            if "gray" in allowed_colors and util.is_gray(rgba.get_rgb()):
                info.append(GRAY_COLOR % (color, rgba.r))
            if "graya" in allowed_colors and util.is_gray(rgba.get_rgb()):
                info.append(GRAYA_COLOR % (color, rgba.r, alpha if alpha else '1'))
            h, l, s = rgba.tohls()
            if "hsl" in allowed_colors:
                info.append(
                    HSL_COLOR % (
                        color, util.fmt_float(h * 360.0), util.fmt_float(s * 100.0), util.fmt_float(l * 100.0)
                    )
                )
            if "hsla" in allowed_colors:
                info.append(
                    HSLA_COLOR % (
                        color, util.fmt_float(h * 360.0), util.fmt_float(s * 100.0), util.fmt_float(l * 100.0),
                        alpha if alpha else '1'
                    )
                )
            h, w, b = rgba.tohwb()
            if "hwb" in allowed_colors:
                info.append(
                    HWB_COLOR % (
                        color, util.fmt_float(h * 360.0), util.fmt_float(w * 100.0), util.fmt_float(b * 100.0)
                    )
                )
            if "hwba" in allowed_colors:
                info.append(
                    HWBA_COLOR % (
                        color, util.fmt_float(h * 360.0), util.fmt_float(w * 100.0), util.fmt_float(b * 100.0),
                        alpha if alpha else '1'
                    )
                )
        return ''.join(info)
dataset/ETHPy150Open facelessuser/ColorHelper/color_helper.py/ColorHelperCommand.format_info/swapped operands of `in`