class HSBType extends PercentType implements ComplexType, State, Command {

    public PercentType[] toXY() {
        // This makes sure we keep color information even if brightness is zero
        PercentType sRGB[] = new HSBType(getHue(), getSaturation(), PercentType.HUNDRED).toRGB();

        float r = gammaDecompress(sRGB[0].floatValue() / 100.0f);
        float g = gammaDecompress(sRGB[1].floatValue() / 100.0f);
        float b = gammaDecompress(sRGB[2].floatValue() / 100.0f);

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

        float x = tmpX / (tmpX + tmpY + tmpZ);
        float y = tmpY / (tmpX + tmpY + tmpZ);

        return new PercentType[] { new PercentType(Float.valueOf(x * 100.0f).toString()),
                new PercentType(Float.valueOf(y * 100.0f).toString()),
                new PercentType(Float.valueOf(tmpY * getBrightness().floatValue()).toString()) };
    }

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

}