See eccen_colors, angle_colors, sigma_colors, and varea_colors.
180418
def retino_colors(vcolorfn, *args, **kwargs):
    ''
    if len(args) == 0:
        def _retino_color_pass(*args, **new_kwargs):
            return retino_colors(vcolorfn, *args,
                                 **{k:(new_kwargs[k] if k in new_kwargs else kwargs[k])
                                    for k in set(kwargs.keys() + new_kwargs.keys())})
        return _retino_color_pass
    elif len(args) > 1:
        raise ValueError('retinotopy color functions accepts at most one argument')
    m = args[0]
    # we need to handle the arguments
    if isinstance(m, (geo.VertexSet, pimms.ITable)):
        tbl = m.properties if isinstance(m, geo.VertexSet) else m
        n = tbl.row_count
        # if the weight or property arguments are lists, we need to thread these along
        if 'property' in kwargs:
            props = kwargs['property']
            del kwargs['property']
            if not (pimms.is_vector(props) or pimms.is_matrix(props)):
                props = [props for _ in range(n)]
        else: props = None
        if 'weight' in kwargs:
            ws = kwargs['weight']
            del kwargs['weight']
            if not pimms.is_vector(ws) and not pimms.is_matrix(ws): ws = [ws for _ in range(n)]
        else: ws = None
        vcolorfn0 = vcolorfn(Ellipsis, **kwargs) if len(kwargs) > 0 else vcolorfn
        if props is None and ws is None: vcfn = lambda m,k:vcolorfn0(m)
        elif props is None:              vcfn = lambda m,k:vcolorfn0(m, weight=ws[k])
        elif ws is None:                 vcfn = lambda m,k:vcolorfn0(m, property=props[k])
        else: vcfn = lambda m,k:vcolorfn0(m, property=props[k], weight=ws[k])
        return np.asarray([vcfn(r,kk) for (kk,r) in enumerate(tbl.rows)])
    else:
        return vcolorfn(m, **kwargs)
138084
function( c, num, variance ){
            if( arguments.length < 3 ){
                variance = ColorRange.DEFAULT_VARIANCE;
            }
            if( arguments.length === 1 ){
                num = c;
                c = undefined;
            }
            var list = new ColorList();
            for( var i=0; i<num; i++){
                list.add(this.getColor(c, variance));
            }
            return list;
        }
535961
def color_intrinsics(self):
        
        return CameraIntrinsics(
            self._frame,
            self._intrinsics[0, 0],
            self._intrinsics[1, 1],
            self._intrinsics[0, 2],
            self._intrinsics[1, 2],
            height=RealSenseSensor.COLOR_IM_HEIGHT,
            width=RealSenseSensor.COLOR_IM_WIDTH,
        )
672646
def _get_colors(self, color_set, alpha, off_color, custom_colors={}):
        
        import matplotlib as mpl
        import matplotlib.pyplot as plt
        color_list = [off_color] * len(self.hkl_list)
        color_proxy_on_wulff = []
        miller_on_wulff = []
        e_surf_on_wulff = [(i, e_surf)
                           for i, e_surf in enumerate(self.e_surf_list)
                           if self.on_wulff[i]]

        c_map = plt.get_cmap(color_set)
        e_surf_on_wulff.sort(key=lambda x: x[1], reverse=False)
        e_surf_on_wulff_list = [x[1] for x in e_surf_on_wulff]
        if len(e_surf_on_wulff) > 1:
            cnorm = mpl.colors.Normalize(vmin=min(e_surf_on_wulff_list),
                                         vmax=max(e_surf_on_wulff_list))
        else:
            # if there is only one hkl on wulff, choose the color of the median
            cnorm = mpl.colors.Normalize(vmin=min(e_surf_on_wulff_list) - 0.1,
                                         vmax=max(e_surf_on_wulff_list) + 0.1)
        scalar_map = mpl.cm.ScalarMappable(norm=cnorm, cmap=c_map)

        for i, e_surf in e_surf_on_wulff:
            color_list[i] = scalar_map.to_rgba(e_surf, alpha=alpha)
            if tuple(self.miller_list[i]) in custom_colors.keys():
                color_list[i] = custom_colors[tuple(self.miller_list[i])]
            color_proxy_on_wulff.append(
                plt.Rectangle((2, 2), 1, 1, fc=color_list[i], alpha=alpha))
            miller_on_wulff.append(self.input_miller_fig[i])
        scalar_map.set_array([x[1] for x in e_surf_on_wulff])
        color_proxy = [plt.Rectangle((2, 2), 1, 1, fc=x, alpha=alpha)
                       for x in color_list]

        return color_list, color_proxy, color_proxy_on_wulff, miller_on_wulff, \
            e_surf_on_wulff_list
333825
def get_color_palette(scheme):
    
    color_schemes = {
        'default': {
            'frames': ['tomato', 'limegreen', 'deepskyblue'], 'background': '#ffffff',
            'color': '#616161', 'ticks': '#757575', 'start': '#ffffff', 'stop': '#909090',
            'rna': '#eaeaea', 'axis': '#e0e0e0', 'grey': '#bdbdbd'
        },
        'colorbrewer': {
            'frames': ['#fc8d62', '#66c2a5', '#8da0cb']
        },
        'rgb': {
            'frames': ['red', 'green', 'blue']
        },
        'greyorfs': {}
    }

    colors = {}
    for k, v in color_schemes['default'].items():
        try:
            vals = color_schemes[scheme][k]
        except KeyError:
            vals = v
        colors[k] = vals
    return colors
261997
def getcolor(spec):
    
    if isinstance(spec, str):
        from matplotlib import colors
        return asarray(colors.hex2color(colors.cnames[spec]))
    else:
        return spec
948666
@Override
	public String colorBySymmetry() {
		// TODO needs some refactoring
		String pointGroup = rotationGroup.getPointGroup();
		QuatSymmetrySubunits subunits = rotationAxisAligner.getSubunits();
		List<Integer> modelNumbers = subunits.getModelNumbers();
		List<String> chainIds = subunits.getChainIds();
		List<List<Integer>> orbits = rotationAxisAligner.getOrbits();

		int n = subunits.getSubunitCount();
		int fold = rotationGroup.getRotation(0).getFold();

		Map<Color4f, List<String>> colorMap = new HashMap<Color4f, List<String>>();

		// Simple Cn symmetry
		if (pointGroup.startsWith("C") && n == fold) {
			colorMap = getCnColorMap();
			// complex cases
		} else if ((pointGroup.startsWith("D") && orbits.size() > 2) ||
				pointGroup.equals("T")|| pointGroup.equals("O") || pointGroup.equals("I")) {
			int nColor = 0;
			if (orbits.size() % 2 == 0) {
				nColor = orbits.size()/2;
			} else {
				nColor = (orbits.size() + 1)/2;
			}
			Color4f[] colors = getSymmetryColors(nColor);

			for (int i = 0; i < orbits.size(); i++) {
				int colorIndex = i;

				// reverse colors once the center of the structure has been reached
				if (i >= nColor) {
					colorIndex = orbits.size() - 1 - i;
				}
				Color4f c = colors[colorIndex];
				List<String> ids = colorMap.get(c);
				if (ids == null) {
					ids = new ArrayList<String>();
					colorMap.put(c,  ids);
				}
				for (int subunit: orbits.get(i)) {
					String id = getChainSpecification(modelNumbers, chainIds, subunit);
					ids.add(id);
				}
			}

			// Simple Dn symmetry
		} else {
			Color4f[] colors = getSymmetryColors(orbits.size());

			for (int i = 0; i < orbits.size(); i++) {
				Color4f c = new Color4f(colors[i]);
				List<String> ids = colorMap.get(c);
				if (ids == null) {
					ids = new ArrayList<String>();
					colorMap.put(c,  ids);
				}
				List<Integer> orbit = orbits.get(i);
				for (int j = 0; j < orbit.size(); j++) {
					String id = getChainSpecification(modelNumbers, chainIds, orbit.get(j));
					ids.add(id);
				}
			}
		}

		return defaultColoring + getJmolColorScript(colorMap) + getJmolLigandScript();
	}
1232413
def get_colors(self, prefix, len_):
        """"""

        def color(tupl):
            """Make a color css"""
            return ((
                '%s.color-{0}, %s.color-{0} a:visited {{\n'
                '  stroke: {1};\n'
                '  fill: {1};\n'
                '}}\n'
            ) % (prefix, prefix)).format(*tupl)

        def value_color(tupl):
            """Make a value color css"""
            return ((
                '%s .text-overlay .color-{0} text {{\n'
                '  fill: {1};\n'
                '}}\n'
            ) % (prefix, )).format(*tupl)

        def ci_color(tupl):
            """Make a value color css"""
            if not tupl[1]:
                return ''
            return (('%s .color-{0} .ci {{\n'
                     '  stroke: {1};\n'
                     '}}\n') % (prefix, )).format(*tupl)

        if len(self.colors) < len_:
            missing = len_ - len(self.colors)
            cycles = 1 + missing // len(self.colors)
            colors = []
            for i in range(0, cycles + 1):
                for color_ in self.colors:
                    colors.append(darken(color_, 33 * i / cycles))
                    if len(colors) >= len_:
                        break
                else:
                    continue
                break
        else:
            colors = self.colors[:len_]

        # Auto compute foreground value color when color is missing
        value_colors = []
        for i in range(len_):
            if i < len(self.value_colors) and self.value_colors[i] is not None:
                value_colors.append(self.value_colors[i])
            else:
                value_colors.append(
                    'white' if is_foreground_light(colors[i]) else 'black'
                )

        return '\n'.join(
            chain(
                map(color, enumerate(colors)),
                map(value_color, enumerate(value_colors)),
                map(ci_color, enumerate(self.ci_colors))
            )
        )
950489
protected function defineColors()
    {
        $this->colors = array(
            'blue'    => chr(27).'[1;34m',
            'red'     => chr(27).'[1;31m',
            'green'   => chr(27).'[1;32m',
            'yellow'  => chr(27).'[1;33m',
            'black'   => chr(27).'[1;30m',
            'magenta' => chr(27).'[1;35m',
            'cyan'    => chr(27).'[1;36m',
            'white'   => chr(27).'[1;37m',
            'grey'    => chr(27).'[0;37m',
            'reset'   => chr(27).'[0m',
        );
    }
1099088
def help(cls):
        """"""
        print("for named colors use :")
        for c in sorted(list(cls.colors.items())):
            print("{:10} {}".format(*c))
1005763
def items(cls):
        
        return [
            cls.TRUE_COLOR,
            cls.FALSE_COLOR,
            cls.NDVI,
            cls.EVI
        ]
1202464
private Color4f[] getSymmetryColors(int nColors) {
		String pointGroup = rotationGroup.getPointGroup();
		Color[] col = null;
		Color4f[] colors = null;
		if (pointGroup.equals("C1")) {
			col = ColorBrewer.Greys.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		} else if (pointGroup.startsWith("C")) {
			col = ColorBrewer.YlGnBu.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		} else if (pointGroup.startsWith("D")) {
			col = ColorBrewer.YlOrRd.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		} else if (pointGroup.equals("T")) {
			col = ColorBrewer.Greens.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		} else if (pointGroup.equals("O")) {
			col = ColorBrewer.Blues.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		} else if (pointGroup.equals("I")) {
			col = ColorBrewer.BuPu.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		} else {
			col = ColorBrewer.Greys.getColorPalette(nColors);
			colors = ColorConverter.convertColor4f(col);
		}
		System.arraycopy(colors, 0, colors, 0, nColors);
		return colors;
	}
626669
def compute_colors_for_labels(self, labels):
        
        colors = labels[:, None] * self.palette
        colors = (colors % 255).numpy().astype("uint8")
        return colors
287657
def colors(self):
        """"""
        try:
            return get_console_info(self._kernel32, self._stream_handle)[:2]
        except OSError:
            return WINDOWS_CODES['white'], WINDOWS_CODES['black']
531476
def _get_color_list():
    """"""
    if 'axes.prop_cycle' in plt.rcParams:
        return [p['color'] for p in list(plt.rcParams['axes.prop_cycle'])]
    else:
        return plt.rcParams['axes.color_cycle']
1327696
def colors
    config[:color] ||= {
      Numeric    => :red    ,
      String     => :green  ,
      Symbol     => :cyan   ,
      Array      => :blue   ,
      Hash       => :blue   ,
      NilClass   => :magenta,
      TrueClass  => :magenta,
      FalseClass => :magenta,
      Exception  => :magenta,
      Object     => :yellow }
  end
117846
private void calculateColor(int coord) {
	    coord = coord - mBarPointerHaloRadius;
		if (coord > (mBarLength / 2) && (coord < mBarLength)) {
			mColor = Color
					.HSVToColor(new float[] {
							mHSVColor[0], 1f, 1 - (mPosToSVFactor * (coord - (mBarLength / 2)))
                    });
		} else if (coord > 0 && coord < mBarLength) {
			mColor = Color.HSVToColor(new float[]{
                    mHSVColor[0], (mPosToSVFactor * coord), 1f
            });
		} else if(coord == (mBarLength / 2)){
            mColor = Color.HSVToColor(new float[]{
                    mHSVColor[0], 1f, 1f
            });
        } else if (coord <= 0) {
			mColor = Color.WHITE;
		} else if (coord >= mBarLength) {
			mColor = Color.BLACK;
		}
	}