class HSBType extends PercentType implements ComplexType, State, Command {

    public static HSBType fromXY(float x, float y) {
        float tmpY = 1.0f;
        float tmpX = (tmpY / y) * x;
        float tmpZ = (tmpY / y) * (1.0f - x - y);

        float r = tmpX * XY2RGB[0][0] + tmpY * XY2RGB[0][1] + tmpZ * XY2RGB[0][2];
        float g = tmpX * XY2RGB[1][0] + tmpY * XY2RGB[1][1] + tmpZ * XY2RGB[1][2];
        float b = tmpX * XY2RGB[2][0] + tmpY * XY2RGB[2][1] + tmpZ * XY2RGB[2][2];

        float max = r > g ? r : g;
        if (b > max) {
            max = b;
        }

        r = gammaCompress(r / max);
        g = gammaCompress(g / max);
        b = gammaCompress(b / max);

        return HSBType.fromRGB((int) (r * 255.0f + 0.5f), (int) (g * 255.0f + 0.5f), (int) (b * 255.0f + 0.5f));
    }

    public  HSBType();
    public  HSBType(DecimalType h, PercentType s, PercentType b);
    public  HSBType(String value);

}