/** * Returns a Color object that corresponds to the input Paint's * CIE Lab color value. * * @param e the element using the color * @param c the CIE Lab color definition * @param opacity the opacity * @param ctx the bridge context to use */ public static Color convertCIELabColor(Element e, CIELabColor c, float opacity, BridgeContext ctx) { CIELabColorSpace cs = new CIELabColorSpace(c.getWhitePoint()); float[] lab = c.getColorValues(); Color specColor = cs.toColor(lab[0], lab[1], lab[2], opacity); return specColor; }
private Value createCIELabColorValue(LexicalUnit lu, Value v) { lu = lu.getParameters(); float l = getColorValue(lu); lu = lu.getNextLexicalUnit(); expectComma(lu); lu = lu.getNextLexicalUnit(); float a = getColorValue(lu); lu = lu.getNextLexicalUnit(); expectComma(lu); lu = lu.getNextLexicalUnit(); float b = getColorValue(lu); CIELabColor icc = new CIELabColor(l, a, b); lu = lu.getNextLexicalUnit(); return icc; }
private Value createCIELabColorValue(LexicalUnit lu, Value v) { lu = lu.getParameters(); float l = getColorValue(lu); lu = lu.getNextLexicalUnit(); expectComma(lu); lu = lu.getNextLexicalUnit(); float a = getColorValue(lu); lu = lu.getNextLexicalUnit(); expectComma(lu); lu = lu.getNextLexicalUnit(); float b = getColorValue(lu); CIELabColor icc = new CIELabColor(l, a, b); lu = lu.getNextLexicalUnit(); return icc; }
/** * Returns a Color object that corresponds to the input Paint's * CIE Lab color value. * * @param e the element using the color * @param c the CIE Lab color definition * @param opacity the opacity * @param ctx the bridge context to use */ public static Color convertCIELabColor(Element e, CIELabColor c, float opacity, BridgeContext ctx) { CIELabColorSpace cs = new CIELabColorSpace(c.getWhitePoint()); float[] lab = c.getColorValues(); Color specColor = cs.toColor(lab[0], lab[1], lab[2], opacity); return specColor; }
private Value createCIELabColorValue(LexicalUnit lu, Value v) { lu = lu.getParameters(); float l = getColorValue(lu); lu = lu.getNextLexicalUnit(); expectComma(lu); lu = lu.getNextLexicalUnit(); float a = getColorValue(lu); lu = lu.getNextLexicalUnit(); expectComma(lu); lu = lu.getNextLexicalUnit(); float b = getColorValue(lu); CIELabColor icc = new CIELabColor(l, a, b); lu = lu.getNextLexicalUnit(); return icc; }
/** * Returns a Color object that corresponds to the input Paint's * CIE Lab color value. * * @param e the element using the color * @param c the CIE Lab color definition * @param opacity the opacity * @param ctx the bridge context to use */ public static Color convertCIELabColor(Element e, CIELabColor c, float opacity, BridgeContext ctx) { CIELabColorSpace cs = new CIELabColorSpace(c.getWhitePoint()); float[] lab = c.getColorValues(); Color specColor = cs.toColor(lab[0], lab[1], lab[2], opacity); return specColor; }