Get the visible counter-color.
425461
def get_visible_color(color):
    """"""
    if isinstance(color, (str, type(""))):
        try:
            return getattr(_Visible, str('{}'.format(color)))
        except AttributeError:
            raise ValueError("incorrect color: {!r}".format(color))
    elif isinstance(color, tuple):
        return (0x80 ^ color[0], 0x80 ^ color[1], 0x80 ^ color[2])
    elif isinstance(color, int):
        if 0 <= color <= 0x07:
            index = color
            return 0xFF if index == 0 else 0xE8
        elif 0x08 <= color <= 0x0F:
            index = color - 0x08
            return 0xFF if index == 0 else 0xE8
        elif 0x10 <= color <= 0xE7:
            index = color - 0x10
            if 0 <= index % 36 < 18:
                return 0xFF
            else:
                return 0x10
        elif 0xE8 <= color <= 0xFF:
            index = color - 0x0E8
            return 0xFF if 0 <= index < 12 else 0xE8
    else:
        raise ValueError("incorrect color: {!r}".format(color))
1262319
def w(self):
        """"""
        if not self._counters_calculated:
            self._counters_calculated = True
            self._extract_counters()

        return self._w
347202
def get_color(self, refresh=False):
        
        if refresh:
            self.refresh_complex_value('CurrentColor')

        ci = self.get_color_index(['R', 'G', 'B'], refresh)
        cur = self.get_complex_value('CurrentColor')
        if ci is None or cur is None:
            return None

        try:
            val = [cur.split(',')[c] for c in ci]
            return [int(v.split('=')[1]) for v in val]
        except IndexError:
            return None
828047
def get_bgcolor(self, index):
        """"""
        column = index.column()
        if not self.bgcolor_enabled:
            return
        value = self.get_value(index.row(), column)
        if self.max_min_col[column] is None or isna(value):
            color = QColor(BACKGROUND_NONNUMBER_COLOR)
            if is_text_string(value):
                color.setAlphaF(BACKGROUND_STRING_ALPHA)
            else:
                color.setAlphaF(BACKGROUND_MISC_ALPHA)
        else:
            if isinstance(value, COMPLEX_NUMBER_TYPES):
                color_func = abs
            else:
                color_func = float
            vmax, vmin = self.return_max(self.max_min_col, column)
            hue = (BACKGROUND_NUMBER_MINHUE + BACKGROUND_NUMBER_HUERANGE *
                   (vmax - color_func(value)) / (vmax - vmin))
            hue = float(abs(hue))
            if hue > 1:
                hue = 1
            color = QColor.fromHsvF(hue, BACKGROUND_NUMBER_SATURATION,
                                    BACKGROUND_NUMBER_VALUE,
                                    BACKGROUND_NUMBER_ALPHA)
        return color
553355
def badge_color(self):
        """"""
        # If no thresholds were passed then return the default color
        if not self.thresholds:
            return self.default_color

        if self.value_type == str:
            if self.value in self.thresholds:
                return self.thresholds[self.value]
            else:
                return self.default_color

        # Convert the threshold dictionary into a sorted list of lists
        threshold_list = [[self.value_type(i[0]), i[1]] for i in self.thresholds.items()]
        threshold_list.sort(key=lambda x: x[0])

        color = None

        for threshold, color in threshold_list:
            if float(self.value) < float(threshold):
                return color

        # If we drop out the top of the range then return the last max color
        if color and self.use_max_when_value_exceeds:
            return color
        else:
            return self.default_color
1325043
function getColor(color)
{
    if (!Array.isArray(color))
    {
        return getSingleColor(color);
    }
    else
    {
        for (let i = 0; i < color.length; ++i)
        {
            color[i] = getSingleColor(color[i]);
        }

        return color;
    }
}
1019929
def get_bgcolor(self, index):
        """"""
        if index.column() == 0:
            color = QColor(Qt.lightGray)
            color.setAlphaF(.05)
        elif index.column() < 3:
            color = QColor(Qt.lightGray)
            color.setAlphaF(.2)
        else:
            color = QColor(Qt.lightGray)
            color.setAlphaF(.3)
        return color
856428
def visible(self, status):
        """"""
        self._display_control = ByteUtil.apply_flag(self._display_control, Command.DISPLAY_ON, status)
        self.command(self._display_control)
746229
def foreground(color):
	""""""
	if color not in foreground_colors:
		return

	if is_win32:
		last_fg = foreground_colors[color][1]
		set_color_win32(last_fg | last_bg)
	else:
		set_color_ansi(foreground_colors[color][0])
1061140
def get_rgb_color(color):
    
    if color == INVERTED:
        foreground = (0, 255, 0)
        background = (0, 65, 0)
    elif color == NORMAL:
        foreground = (0, 65, 0)
        background = (0, 255, 0)
    else:
        foreground = (0, 0, 0)
        background = COLOR_INFO[color]
    return (foreground, background)
916967
def status_color(status):
        """"""
        status_color = c.Fore.GREEN
        if not status:
            status_color = c.Fore.RED
        return status_color
177232
def gdk(self, color):
        """"""
        c = self.parse(color)
        return gdk.Color.from_floats(c)
953317
def contrast(self, color, step):
        """"""
        hls = colorsys.rgb_to_hls(*self.rgb(color))
        if self.is_light(color):
            return colorsys.hls_to_rgb(hls[0], hls[1] - step, hls[2])
        else:
            return colorsys.hls_to_rgb(hls[0], hls[1] + step, hls[2])
1053032
def palette(fg, bg=-1):
    

    if not hasattr(palette, "counter"):
        palette.counter = 1

    if not hasattr(palette, "selections"):
        palette.selections = {}

    selection = "%s%s" % (str(fg), str(bg))
    if not selection in palette.selections:
        palette.selections[selection] = palette.counter
        palette.counter += 1

    # Get available colours
    colors = [c for c in dir(_curses) if c.startswith('COLOR')]
    if isinstance(fg, str):
        if not "COLOR_"+fg.upper() in colors:
            fg = -1
        else:
            fg = getattr(_curses, "COLOR_"+fg.upper())
    if isinstance(bg, str):
        if not "COLOR_"+bg.upper() in colors:
            bg = -1
        else:
            bg = getattr(_curses, "COLOR_"+bg.upper())

    _curses.init_pair(palette.selections[selection], fg, bg)
    return _curses.color_pair(palette.selections[selection])
351321
def get_color(self):
        
        col = np.full((self._dStruct['nObj'],4), np.nan)
        ii = 0
        for k in self._dStruct['lorder']:
            k0, k1 = k.split('_')
            col[ii,:] = self._dStruct['dObj'][k0][k1].get_color()
            ii += 1
        return col
50419
def _get_scope_highlight_color(self):
        
        color = self.editor.sideareas_color
        if color.lightness() < 128:
            color = drift_color(color, 130)
        else:
            color = drift_color(color, 105)
        return color
292006
def get_color_data(self, condition):
        '''
        
        '''
        if condition not in self.color_icons:
            # Check for similarly-named conditions if no exact match found
            condition_lc = condition.lower()
            if 'cloudy' in condition_lc or 'clouds' in condition_lc:
                if 'partly' in condition_lc:
                    condition = 'Partly Cloudy'
                else:
                    condition = 'Cloudy'
            elif condition_lc == 'overcast':
                condition = 'Cloudy'
            elif 'thunder' in condition_lc or 't-storm' in condition_lc:
                condition = 'Thunderstorm'
            elif 'snow' in condition_lc:
                condition = 'Snow'
            elif 'rain' in condition_lc or 'showers' in condition_lc:
                condition = 'Rainy'
            elif 'sunny' in condition_lc:
                condition = 'Sunny'
            elif 'clear' in condition_lc or 'fair' in condition_lc:
                condition = 'Fair'
            elif 'fog' in condition_lc:
                condition = 'Fog'

        return self.color_icons['default'] \
            if condition not in self.color_icons \
            else self.color_icons[condition]