from . import st_helper
    from .color_converter import ColorConverter
    from .color_searcher import ColorSearcher
    from .color_selection_listener import search_colors_in_selection
    from .regex_compiler import compile_regex
    from .settings import Settings, COLOR_HIGHLIGHTER_SETTINGS_NAME
except ValueError:
    import st_helper
    from color_converter import ColorConverter
    from color_searcher import ColorSearcher
    from color_selection_listener import search_colors_in_selection
    from regex_compiler import compile_regex
    from settings import Settings, COLOR_HIGHLIGHTER_SETTINGS_NAME


if st_helper.running_in_st():
    import sublime  # pylint: disable=import-error
    import sublime_plugin  # pylint: disable=import-error
else:
    from . import sublime
    from . import sublime_plugin


class ColorHighlighterNextColor(sublime_plugin.TextCommand):
    """Convert currently selected colors to a next color format."""

    def run(self, edit):
        """
        Run the command.

        Arguments:
"""A ST3 command for setting plugin settings."""

try:
    from . import st_helper
    from .settings import COLOR_HIGHLIGHTER_SETTINGS_NAME, ColorSchemeColorHighlighterSettings, Settings
except ValueError:
    import st_helper
    from settings import COLOR_HIGHLIGHTER_SETTINGS_NAME, ColorSchemeColorHighlighterSettings, Settings

if st_helper.running_in_st():
    import sublime  # pylint: disable=import-error
    import sublime_plugin  # pylint: disable=import-error
else:
    from . import sublime
    from . import sublime_plugin


class ColorHighlighterSetSetting(sublime_plugin.ApplicationCommand):
    """
    A ST3 command for setting plugin settings.

    It supports:
    - Regular settings that just get set.
    - Boolean settings that get flipped.
    - Enum settings that have a special "none" value that gets mapped to flipping a specified boolean setting.
    - Computed boolean settings which get automatically recomputed every time it's dependencies are recomputed.
    - Disabling some settings or setting prefixes for ST2.
    """

    _BOOL_SETTINGS = [
        "autoreload.when_settings_change",
"""Helper functions for manipulating regions."""

try:
    from .st_helper import running_in_st
except ValueError:
    from st_helper import running_in_st

if running_in_st():
    import sublime  # pylint: disable=import-error
else:
    from . import sublime


class NormalizedRegion(object):
    """
    A convenient wrapper around sublime.Region.

    Regions can have their end smaller than their beginning. This happens, for example, when the user selects from
    right to left. This function normalizes such regions to have their end always before their beginning.
    """
    def __init__(self, a, b=None):
        """
        Initialize a region with a sublime.Region.

        Arguments:
        a -- a sublime.Region to normalize or the regions's beginning.
        b -- the regions's end. Only set if a is the regions's beginning.
        """
        if b is None:
            # a is a sublime.Region.
            b = a.b
import os
import subprocess
import threading

try:
    from . import path
    from .st_helper import running_in_st
    from .color_highlighter import ColorHighlighter
except ValueError:
    import path
    from st_helper import running_in_st
    from color_highlighter import ColorHighlighter


if running_in_st():
    import sublime  # pylint: disable=import-error
else:
    from . import sublime


class IconFactory(object):
    """A class for generating gutter icons with different styles and colors."""

    _icon_style_circle = "circle"
    _icon_style_square = "square"
    _convert_styles = {
        _icon_style_circle: "circle 15,16 8,10",
        _icon_style_square: "rectangle 4,4 24,24"
    }
    _convert_command_template = (