Create a HSL color.
@param color argb color
@return the HSL
480291
static HSL toHSL( double color ) {
        long argb = Double.doubleToRawLongBits( color );
        double a = alpha( color );
        double r = clamp( ((argb >> 32) & 0xFFFF) / (double)0xFF00 );
        double g = clamp( ((argb >> 16) & 0xFFFF) / (double)0xFF00 );
        double b = clamp( ((argb >> 0) & 0xFFFF) / (double)0xFF00 );

        double max = Math.max( Math.max( r, g ), b );
        double min = Math.min( Math.min( r, g ), b );
        double h, s, l = (max + min) / 2, d = max - min;

        if( max == min ) {
            h = s = 0;
        } else {
            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);

            if( max == r ) {
                h = (g - b) / d + (g < b ? 6 : 0);
            } else if( max == g ) {
                h = (b - r) / d + 2;
            } else {
                h = (r - g) / d + 4;
            }
            h /= 6;
        }
        return new HSL( h * 360, s, l, a );
    }
884610
public static int getDisplayColorFromColor(int color) {
        if (!isJellybeanOrLater()) {
            return color;
        }

        float[] hsv = new float[3];
        Color.colorToHSV(color, hsv);
        hsv[1] = Math.min(hsv[1] * SATURATION_ADJUST, 1.0f);
        hsv[2] = hsv[2] * INTENSITY_ADJUST;
        return Color.HSVToColor(hsv);
    }
500229
@SuppressWarnings({ "checkstyle:magicnumber", "static-method" })
	@Pure
	public Color rgba(int color) {
		final int alpha = (color & 0xFF000000) >> 24;
		final int red = (color & 0x00FF0000) >> 16;
		final int green = (color & 0x0000FF00) >> 8;
		final int blue = color & 0x000000FF;
		final double opacity;
		switch (alpha) {
		case 0:
			opacity = 0.;
			break;
		case 255:
			opacity = 1.;
			break;
		default:
			opacity = ((double) alpha) / 255;
		}
		return Color.rgb(red, green, blue, opacity);
	}
1134792
public JFreeChartRender setGridPaint(Color color) {
        getPlot().setRangeGridlinePaint(color);
        getPlot().setDomainGridlinePaint(color);
        return this;
    }
322659
public void setColor(final Color COLOR) {
        if (null == color) {
            _color = COLOR;
            fireSectionEvent(UPDATE_EVENT);
        } else {
            color.set(COLOR);
        }
    }
245333
public static Palette createPalette(final Color color, final Color... colors) {
        Color[] cs = new Color[colors.length + 1];
        cs[0] = color;
        System.arraycopy(colors, 0, cs, 1, colors.length);
        return new FixedPalette(cs);
    }
775296
function ( color, type ) {
            switch ( type ) {
                case 'rgb':
                    return this.toRgb( color );
                    break;
                case 'rgba':
                    return this.toRgba( color );
                    break;
                case 'hsl':
                    return this.toHsl( color );
                    break;
                case 'hsla':
                    return this.toHsla( color );
                    break;
                default:
                    return this.toHex( color );
                    break;
            }
        }
1162505
public T setStrokeColor(final IColor color)
    {
        return setStrokeColor(null == color ? null : color.getColorString());
    }
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]);
    }
492754
public static String shorthandHexSingle(String color) {
		validateHexSingle(color);
		if (color.length() > 1
				&& Character.toUpperCase(color.charAt(0)) == Character
						.toUpperCase(color.charAt(1))) {
			color = color.substring(0, 1);
		}
		return color;
	}
521634
public DataRange color(String... colors) {
        if (colors == null || colors.length == 0) {
            return this;
        }
        this.color().addAll(Arrays.asList(colors));
        return this;
    }
955133
public static Color colorWithoutAlpha( Color color ) {
        return new Color(color.getRed(), color.getGreen(), color.getBlue());
    }
903240
@CheckReturnValue
    public RoleAction setColor(Color color)
    {
        return this.setColor(color != null ? color.getRGB() : null);
    }
826017
@ColorInt
    public static int opaqueColor(@ColorInt int color) {
        int alpha = Color.alpha(color);
        if (alpha == 0) return color;
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(255, red, green, blue);
    }
815200
public static String toHex(int color) {
		validateRGB(color);
		String hex = Integer.toHexString(color).toUpperCase();
		if (hex.length() == 1) {
			hex = "0" + hex;
		}
		return hex;
	}
658817
public void setHighlightColor(final Color COLOR) {
        if (null == highlightColor) {
            _highlightColor = COLOR;
        } else {
            highlightColor.set(COLOR);
        }
    }
1026300
public static GenericColor valueOf(Color color) {

    Objects.requireNonNull(color, "color");
    Red red = new Red(color.getRed());
    Green green = new Green(color.getGreen());
    Blue blue = new Blue(color.getBlue());
    Alpha alpha = new Alpha(color.getAlpha());
    return valueOf(red, green, blue, alpha);
  }