What is the most commonly occurring color.

        Returns
        ------------
        color: (4,) uint8, most common color
763451
def main_color(self):
        
        if self.kind is None:
            return DEFAULT_COLOR
        elif self.kind == 'face':
            colors = self.face_colors
        elif self.kind == 'vertex':
            colors = self.vertex_colors
        else:
            raise ValueError('color kind incorrect!')

        # find the unique colors
        unique, inverse = grouping.unique_rows(colors)
        # the most commonly occurring color, or mode
        # this will be an index of inverse, not colors
        mode_index = np.bincount(inverse).argmax()
        color = colors[unique[mode_index]]

        return color
941735
def random_color(hue: rand(360), saturation: rand, brightness: rand, kelvin: DEFAULT_KELVIN)
      Color.new(hue, saturation, brightness, kelvin)
    end
96711
def _get_colors(segmentation):
    
    symbol_count = len(segmentation)
    num_colors = symbol_count

    # See http://stackoverflow.com/a/20298116/562769
    color_array = [
        "#000000", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941",
        "#006FA6", "#A30059", "#FFDBE5", "#7A4900", "#0000A6", "#63FFAC",
        "#B79762", "#004D43", "#8FB0FF", "#997D87", "#5A0007", "#809693",
        "#FEFFE6", "#1B4400", "#4FC601", "#3B5DFF", "#4A3B53", "#FF2F80",
        "#61615A", "#BA0900", "#6B7900", "#00C2A0", "#FFAA92", "#FF90C9",
        "#B903AA", "#D16100", "#DDEFFF", "#000035", "#7B4F4B", "#A1C299",
        "#300018", "#0AA6D8", "#013349", "#00846F", "#372101", "#FFB500",
        "#C2FFED", "#A079BF", "#CC0744", "#C0B9B2", "#C2FF99", "#001E09",
        "#00489C", "#6F0062", "#0CBD66", "#EEC3FF", "#456D75", "#B77B68",
        "#7A87A1", "#788D66", "#885578", "#FAD09F", "#FF8A9A", "#D157A0",
        "#BEC459", "#456648", "#0086ED", "#886F4C",

        "#34362D", "#B4A8BD", "#00A6AA", "#452C2C", "#636375", "#A3C8C9",
        "#FF913F", "#938A81", "#575329", "#00FECF", "#B05B6F", "#8CD0FF",
        "#3B9700", "#04F757", "#C8A1A1", "#1E6E00", "#7900D7", "#A77500",
        "#6367A9", "#A05837", "#6B002C", "#772600", "#D790FF", "#9B9700",
        "#549E79", "#FFF69F", "#201625", "#72418F", "#BC23FF", "#99ADC0",
        "#3A2465", "#922329", "#5B4534", "#FDE8DC", "#404E55", "#0089A3",
        "#CB7E98", "#A4E804", "#324E72", "#6A3A4C", "#83AB58", "#001C1E",
        "#D1F7CE", "#004B28", "#C8D0F6", "#A3A489", "#806C66", "#222800",
        "#BF5650", "#E83000", "#66796D", "#DA007C", "#FF1A59", "#8ADBB4",
        "#1E0200", "#5B4E51", "#C895C5", "#320033", "#FF6832", "#66E1D3",
        "#CFCDAC", "#D0AC94", "#7ED379", "#012C58"]

    # Apply a little trick to make sure we have enough colors, no matter
    # how many symbols are in one recording.
    # This simply appends the color array as long as necessary to get enough
    # colors
    new_array = color_array[:]
    while len(new_array) <= num_colors:
        new_array += color_array

    return new_array[:num_colors]
428224
function getRandomColors() {
    var letters = '0123456789ABCDEF'.split('');
    var _color = '#';
    for (var i = 0; i < 6; i++) {
        _color += letters[Math.floor(Math.random() * 16)];
    }
    return _color;
}
684997
def get_system_bck_color():
        
        def merged_colors(colorA, colorB, factor):
            maxFactor = 100
            colorA = QtGui.QColor(colorA)
            colorB = QtGui.QColor(colorB)
            tmp = colorA
            tmp.setRed((tmp.red() * factor) / maxFactor +
                       (colorB.red() * (maxFactor - factor)) / maxFactor)
            tmp.setGreen((tmp.green() * factor) / maxFactor +
                         (colorB.green() * (maxFactor - factor)) / maxFactor)
            tmp.setBlue((tmp.blue() * factor) / maxFactor +
                        (colorB.blue() * (maxFactor - factor)) / maxFactor)
            return tmp

        pal = QtWidgets.QApplication.instance().palette()
        b = pal.window().color()
        h = pal.highlight().color()
        return merged_colors(b, h, 50)
1199480
def get_random_xy_color(self):
        """"""
        r = self.color.random_rgb_value()
        g = self.color.random_rgb_value()
        b = self.color.random_rgb_value()
        return self.rgb_to_xy(r, g, b)
84615
function(i) {
		var color = ((i >> 24) & 0xFF).toString(16) +
			((i >> 16) & 0xFF).toString(16) +
			((i >> 8) & 0xFF).toString(16) +
			(i & 0xFF).toString(16);
		return color;
	}
866175
def colors(self, p_hint_possible=True):
        
        lookup = {
            'false': 0,
            'no': 0,
            '0': 0,
            '1': 16,
            'true': 16,
            'yes': 16,
            '16': 16,
            '256': 256,
        }

        try:
            forced = self.cp.get('topydo', 'force_colors') == '1'
        except ValueError:
            forced = self.defaults['topydo']['force_colors'] == '1'

        try:
            colors = lookup[self.cp.get('topydo', 'colors').lower()]  # pylint: disable=no-member
        except ValueError:
            colors = lookup[self.defaults['topydo']['colors'].lower()]  # pylint: disable=no-member
        except KeyError:
            # for invalid values or 'auto'
            colors = 16 if p_hint_possible else 0

        # disable colors when no colors are enforced on the commandline and
        # color support is determined automatically
        return 0 if not forced and not p_hint_possible else colors
869549
def _get_color(self, r, g, b):
        
        clr = (r, g, b)
        return clr
1340377
function randColor (colorType) {
  if (colorType === 'rgba') {
    let a = []
    for (let i = 0; i < 3; i++) {
      a.push(tools.rnd(0, 255))
    }
    a.push(Math.round(Math.random() * 10) / 10)
    return `rgba(${a[0]},${a[1]},${a[2]},${a[3]})`
  } else {
    return `#${randData('0123456789abcdef', 6)}`
  }
}
81325
def get_edge_color(self, increment=1):
        

        i = self.edge_colors_index

        self.edge_colors_index += increment
        if self.edge_colors_index >= len(self.edge_colors):
            self.edge_colors_index = self.edge_colors_index-len(self.edge_colors)
            if self.edge_colors_index >= len(self.edge_colors): self.edge_colors_index=0 # to be safe

        return self.edge_colors[i]
805658
def scolor(self):
        
        global palette
        color = palette[self.color_index]
        if len(palette) - 1 == self.color_index:
            self.color_index = 0
        else:
            self.color_index += 1
        self.color(color)
402396
def color(self):
        """"""
        color = idc.GetColor(self.ea, idc.CIC_FUNC)
        if color == 0xFFFFFFFF:
            return None

        return color
587176
def agent_color(self, val):
        
        if val == '0': 
            colour = 'blue'
        elif val == '1':
            colour = 'navy'
        elif val == '2':
            colour = 'firebrick'
        elif val == '3':
            colour = 'blue'
        elif val == '4':
            colour = 'blue2'
        elif val == '5':
            colour = 'blue4'
        elif val == '6':
            colour = 'gray22'
        elif val == '7':
            colour = 'gray57'
        elif val == '8':
            colour = 'red4'
        elif val == '9':
            colour = 'red3'

    
        
        return colour
757404
def to_irc(self) -> int:
        
        d = {
            (self.BLACK, True): 14,
            (self.BLACK, False): 1,
            (self.RED, True): 4,
            (self.RED, False): 5,
            (self.GREEN, True): 9,
            (self.GREEN, False): 3,
            (self.YELLOW, True): 8,
            (self.YELLOW, False): 7,
            (self.BLUE, True): 12,
            (self.BLUE, False): 2,
            (self.MAGENTA, True): 13,
            (self.MAGENTA, False): 6,
            (self.CYAN, True): 11,
            (self.CYAN, False): 10,
            (self.WHITE, True): 0,
            (self.WHITE, False): 15
        }
        return d[(self.color, self.bright)]
168139
def get_color_index(self, colors, refresh=False):
        
        if refresh:
            self.refresh_complex_value('SupportedColors')

        sup = self.get_complex_value('SupportedColors')
        if sup is None:
            return None

        sup = sup.split(',')
        if not set(colors).issubset(sup):
            return None

        return [sup.index(c) for c in colors]
76673
def __format_occurence(self, occurence):
        

        color = "rgb({0}, {1}, {2})"
        span_format = "<span style=\"color: {0};\">{{0}}</span>".format(color.format(self.__default_line_color.red(),
                                                                                     self.__default_line_color.green(),
                                                                                     self.__default_line_color.blue()))
        line = foundations.strings.to_string(occurence.text)
        start = span_format.format(line[:occurence.column])
        pattern = "<b>{0}</b>".format(line[occurence.column:occurence.column + occurence.length])
        end = span_format.format(line[occurence.column + occurence.length:])
        return "".join((start, pattern, end))