Generate the color of the given section.

@param header
of the section
@return color of the section
484281
private Color getSectionColor(SectionHeader header) {
		// color is based on section number
		int nr = header.getNumber();
		Color sectionColor = colorMap.get(SECTION_START);
		// modify the color section number times
		for (int i = 1; i < nr; i++) {
			sectionColor = variate(sectionColor);
		}
		return sectionColor;
	}
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;
    }
442807
public T header(String title, Iterable<HtmlResource> resources) throws IOException {
		return (T) begin("html")
			.begin("head")
			.begin("title").text("Simon Console: ").text(title).end("title")
			.resources(resources)
			.end("head")
			.begin("body")
			.begin("h1")
			.write("<img id=\"logo\" src=\"../resource/images/logo.png\" alt=\"Logo\" />")
			.text("Simon Console: ").text(title)
			.end("h1");
	}
351835
public HSBColor getComplementaryColor() {
        double[] rgb = HSBColor.getRGB(hue, saturation, brightness);
        double[] hsb = HSBColor.getHSB(1.0 - rgb[0], 1.0 - rgb[1], 1.0 - rgb[2]);
        return new HSBColor(hsb[0], hsb[1], hsb[2]);
    }
805609
@ColorInt
    public static int getAlphaColor(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(alpha, red, green, blue);
    }
897419
private String getHTMLColor(SToken token) {

    if (!markedAndCovered.containsKey(token)) {
      return null;
    }

    /**
     * Since the range in markedAndCovered is from 1 up to 8, we have to
     * decrease the value, for matching the colors in KWIC.
     */
    int color = (int) (long) markedAndCovered.get(token);
    color = Math.min(color > 0 ? color - 1 : color,
            MatchedNodeColors.values().length - 1);

    return MatchedNodeColors.values()[color].getHTMLColor();
  }
275181
def colour_diff(diff_lines):
    

    try:
        import colorama
    except ImportError:
        # colorama is not available, print plain diff
        print(''.join(list(diff_lines)))
        return

    colorama.init()

    def p_green(text):
        """ Print added line in green """
        print(colorama.Fore.GREEN + text + colorama.Fore.WHITE, end='')

    def p_yellow(text):
        """ Print diff section header in yellow """
        print(colorama.Fore.YELLOW + text + colorama.Fore.WHITE, end='')

    def p_red(text):
        """ Print removed line in red """
        print(colorama.Fore.RED + text + colorama.Fore.WHITE, end='')
    section = re.compile('@@\s+-\d\d,\d\d\s\+\d\d,\d\d\s+@@')
    for line in diff_lines:
        if line.startswith('-'):
            p_red(line)
        elif line.startswith('+'):
            p_green(line)
        elif section.search(line):
            p_yellow(line)
        else:
            print(line, end='')
148708
public int color(Context ctx) {
        if (mColorInt == 0 && mColorRes != -1) {
            mColorInt = ContextCompat.getColor(ctx, mColorRes);
        }
        return mColorInt;
    }
759925
public static final Color fromHSL(double h, double s, double l)
    {
        h = (((h % 360) + 360) % 360) / 360;

        s = convertPercents(s);

        l = convertPercents(l);

        return fromNormalizedHSL(h, s, l);
    }
3586
public Content getUserHeaderFooter(boolean header) {
        String content;
        if (header) {
            content = replaceDocRootDir(configuration.header);
        } else {
            if (configuration.footer.length() != 0) {
                content = replaceDocRootDir(configuration.footer);
            } else {
                content = replaceDocRootDir(configuration.header);
            }
        }
        Content rawContent = new RawHtml(content);
        return rawContent;
    }
947878
private Color variate(Color color) {
		assert color != null;
		final int diff = 30;
		// darken the color for value of diff
		int newRed = shiftColorPart(color.getRed() - diff);
		int newGreen = shiftColorPart(color.getGreen() - diff);
		int newBlue = shiftColorPart(color.getBlue() - diff);
		Color newColor = new Color(newRed, newGreen, newBlue);
		// start at the original section color again if darkening accidentally
		// resulted in black, which has already the meaning of section caves.
		if (newColor.equals(Color.black)) {
			newColor = colorMap.get(SECTION_START);
		}
		return newColor;
	}
441512
public void setColor(Color c) {
		boolean renderAgain = (c != m_color) && isRendered();
		m_color = c;
		if (renderAgain)
			render(g2d);
	}
1054372
public void setCustomHeader(String[] header) {
        if (header == null) {
            throw new IllegalArgumentException("Custom header can't be null.");
        }
        customHeader = new CustomHeaderLine[header.length];
        for (int i = 0; i < header.length; i++) {
            customHeader[i] = new CustomHeaderLine(header[i]);
        }
    }
298037
public static String encodeColor(Color color, String prefix) {
		final StringBuffer builder = new StringBuffer(prefix);
		String colorHex;
		colorHex = Integer.toHexString(color.getRed());
		if (1 == colorHex.length()) {
			builder.append('0');
		}
		builder.append(colorHex);
		colorHex = Integer.toHexString(color.getGreen());
		if (1 == colorHex.length()) {
			builder.append('0');
		}
		builder.append(colorHex);
		colorHex = Integer.toHexString(color.getBlue());
		if (1 == colorHex.length()) {
			builder.append('0');
		}
		builder.append(colorHex);
		return builder.toString();
	}
242499
public int color(Context ctx, @AttrRes int colorStyle, @ColorRes int colorDefaultRes) {
        //get the color from the holder else from the theme
        int color = color(ctx);
        if (color == 0) {
            return UIUtils.getThemeColorFromAttrOrRes(ctx, colorStyle, colorDefaultRes);
        } else {
            return color;
        }
    }
1373997
public final void setHelperTextColor(@ColorInt final int color) {
        this.helperTextColor = color;

        if (!(Boolean) leftMessage.getTag()) {
            leftMessage.setTextColor(color);
        }

        if (!(Boolean) rightMessage.getTag()) {
            rightMessage.setTextColor(color);
        }
    }
913033
public String header(String k) {
    List<String> vs = headers.get(k);
    return (vs == null || vs.isEmpty()) ? null : vs.get(0);
  }