Looks up a colorization by class and color names.
517363
public Colorization getColorization (String className, String colorName)
    {
        ClassRecord crec = getClassRecord(className);
        if (crec != null) {
            int colorId = 0;
            try {
                colorId = crec.getColorId(colorName);
            } catch (ParseException pe) {
                log.info("Error getting colorization by name", "error", pe);
                return null;
            }

            ColorRecord color = crec.colors.get(colorId);
            if (color != null) {
                return color.getColorization();
            }
        }
        return null;
    }
103266
def calculate_colors(self, values):
        """"""
        # set domain if it is not set
        _flattenedList = list(flatten(values))
        if not self.is_domain_set:
            self.set_domain(_flattenedList)

        _flattenedColors = range(len(_flattenedList))
        for count, value in enumerate(_flattenedList):
            _flattenedColors[count] = self.calculate_color(value)

        return unflatten(values, iter(_flattenedColors))
751170
public ColorRecord getColorRecord (String className, String colorName)
    {
        ClassRecord record = getClassRecord(className);
        if (record == null) {
            log.warning("Requested unknown color class",
                "className", className, "colorName", colorName, new Exception());
            return null;
        }

        int colorId = 0;
        try {
            colorId = record.getColorId(colorName);
        } catch (ParseException pe) {
            log.info("Error getting color record by name", "error", pe);
            return null;
        }

        return record.colors.get(colorId);
    }
79711
def getBoundsColor(self, nNumOutputColors, flCollisionBoundsFadeDistance):
        """"""

        fn = self.function_table.getBoundsColor
        pOutputColorArray = HmdColor_t()
        pOutputCameraColor = HmdColor_t()
        fn(byref(pOutputColorArray), nNumOutputColors, flCollisionBoundsFadeDistance, byref(pOutputCameraColor))
        return pOutputColorArray, pOutputCameraColor
198651
def get_color_mode(mode):
    """"""
    name = mode.upper()
    name = name.rstrip('A')  # Trim alpha.
    name = {'1': 'BITMAP', 'L': 'GRAYSCALE'}.get(name, name)
    return getattr(ColorMode, name)
1284934
def _short_color_list(self):
        """"""
        return [c for c in colors.get_colors() if not re.search(r'\d', c)]
261997
def getcolor(spec):
    
    if isinstance(spec, str):
        from matplotlib import colors
        return asarray(colors.hex2color(colors.cnames[spec]))
    else:
        return spec
1217802
public boolean isLegalStartColor (int classId, int colorId)
    {
        ColorRecord color = getColorRecord(classId, colorId);
        return (color == null) ? false : color.starter;
    }
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']
1068598
def color_reducer(c1, c2):
    """"""
    return tuple(v1 + v2 for v1, v2 in itertools.izip(c1, c2))
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]
225251
def vis_detection(im_orig, detections, class_names, thresh=0.7):
    """"""
    import matplotlib.pyplot as plt
    import random
    plt.imshow(im_orig)
    colors = [(random.random(), random.random(), random.random()) for _ in class_names]
    for [cls, conf, x1, y1, x2, y2] in detections:
        cls = int(cls)
        if cls > 0 and conf > thresh:
            rect = plt.Rectangle((x1, y1), x2 - x1, y2 - y1,
                                 fill=False, edgecolor=colors[cls], linewidth=3.5)
            plt.gca().add_patch(rect)
            plt.gca().text(x1, y1 - 2, '{:s} {:.3f}'.format(class_names[cls], conf),
                           bbox=dict(facecolor=colors[cls], alpha=0.5), fontsize=12, color='white')
    plt.show()
1045034
def _get_css_classes(self, ttype):
        """"""
        cls = self._get_css_class(ttype)
        while ttype not in STANDARD_TYPES:
            ttype = ttype.parent
            cls = self._get_css_class(ttype) + ' ' + cls
        return cls
852345
def lookup_color(p_color):
    
    if not lookup_color.colors:
        lookup_color.colors[AbstractColor.NEUTRAL] = Color('NEUTRAL')
        lookup_color.colors[AbstractColor.PROJECT] = config().project_color()
        lookup_color.colors[AbstractColor.CONTEXT] = config().context_color()
        lookup_color.colors[AbstractColor.META] = config().metadata_color()
        lookup_color.colors[AbstractColor.LINK] = config().link_color()

    try:
        return lookup_color.colors[p_color]
    except KeyError:
        return p_color
1123655
private boolean inBlackList(String className) {
        for (String prefix : blackPrefixList) {
            if (className.startsWith(prefix)) {
                return Boolean.TRUE;
            }
        }
        return Boolean.FALSE;
    }
686814
def get_colorized_contents(contents, color_config):
    """"""
    colorizer = color.EgColorizer(color_config)
    result = colorizer.colorize_text(contents)
    return result
177232
def gdk(self, color):
        """"""
        c = self.parse(color)
        return gdk.Color.from_floats(c)