class ColorItem extends DimmerItem {

    @Override
    public void setState(State state) {
        if (isAcceptedState(acceptedDataTypes, state)) {
            State currentState = this.state;

            if (currentState instanceof HSBType) {
                DecimalType hue = ((HSBType) currentState).getHue();
                PercentType saturation = ((HSBType) currentState).getSaturation();
                // we map ON/OFF values to dark/bright, so that the hue and saturation values are not changed
                if (state == OnOffType.OFF) {
                    applyState(new HSBType(hue, saturation, PercentType.ZERO));
                } else if (state == OnOffType.ON) {
                    applyState(new HSBType(hue, saturation, PercentType.HUNDRED));
                } else if (state instanceof PercentType && !(state instanceof HSBType)) {
                    applyState(new HSBType(hue, saturation, (PercentType) state));
                } else if (state instanceof DecimalType && !(state instanceof HSBType)) {
                    applyState(new HSBType(hue, saturation,
                            new PercentType(((DecimalType) state).toBigDecimal().multiply(BigDecimal.valueOf(100)))));
                } else {
                    applyState(state);
                }
            } else {
                // try conversion
                State convertedState = state.as(HSBType.class);
                if (convertedState != null) {
                    applyState(convertedState);
                } else {
                    applyState(state);
                }
            }
        } else {
            logSetTypeError(state);
        }
    }

    public  ColorItem(String name);

}