Examples of toColor()


Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace.toColor()

                break;
            case ColorSpace.TYPE_Lab:
                //Not sure if this always D50 here,
                //but the illuminant in the header is fixed to D50.
                CIELabColorSpace labCS = ColorSpaces.getCIELabColorSpaceD50();
                result[i] = new NamedColorSpace(name, labCS.toColor(colorvalue, 1.0f),
                        profileName, profileURI);
                break;
            default:
                throw new UnsupportedOperationException(
                        "PCS type is not supported: " + profile.getPCSType());
View Full Code Here

Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace.toColor()

            g2d.setColor(colCMYK);
            g2d.fillRect(60, 30, 40, 40);

            //Try CIELab (not implemented, yet)
            CIELabColorSpace d50 = ColorSpaces.getCIELabColorSpaceD50();
            Color colLab = d50.toColor(83.25f, 16.45f, 96.89f, 1.0f);
            g2d.setColor(colLab);
            g2d.fillRect(110, 30, 40, 40);

            //Try named color (Separation, not implemented, yet)
            float[] c1xyz = d50.toCIEXYZNative(83.25f, 16.45f, 96.89f);
View Full Code Here

Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace.toColor()

                float b = parseComponent(args[5], -127f, 127f, value);

                //Assuming the XSL-FO spec uses the D50 white point
                CIELabColorSpace cs = ColorSpaces.getCIELabColorSpaceD50();
                //use toColor() to have components normalized
                Color labColor = cs.toColor(l, a, b, 1.0f);
                //Convert to ColorWithFallback
                parsedColor = new ColorWithFallback(labColor, sRGB);
            } catch (RuntimeException re) {
                throw new PropertyException(re);
            }
View Full Code Here

Examples of org.openhab.core.library.types.HSBType.toColor()

    // get RGB hex value
    State state = itemUIRegistry.getState(cp);
    String hexValue = "#ffffff";
    if(state instanceof HSBType) {
      HSBType hsbState = (HSBType) state;
      Color color = hsbState.toColor();
      hexValue = "#" + Integer.toHexString(color.getRGB()).substring(2);
    }
    String label = getLabel(cp);
    String purelabel = label;
    if(label.contains("<span>")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.