package org.apache.poi.xddf.usermodel;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlObject;
import org.openxmlformats.schemas.drawingml.x2006.main.CTColor;
import org.openxmlformats.schemas.drawingml.x2006.main.CTHslColor;
@Beta
public class XDDFColorHsl extends XDDFColor {
private CTHslColor color;
public XDDFColorHsl(int hue, int saturation, int luminance) {
this(CTHslColor.Factory.newInstance(), CTColor.Factory.newInstance());
setHue(hue);
setSaturation(saturation);
setLuminance(luminance);
}
@Internal
protected XDDFColorHsl(CTHslColor color) {
this(color, null);
}
@Internal
protected XDDFColorHsl(CTHslColor color, CTColor container) {
super(container);
this.color = color;
}
@Override
@Internal
protected XmlObject getXmlObject() {
return color;
}
public int getHue() {
return color.getHue2();
}
public void setHue(int hue) {
color.setHue2(hue);
}
public int getSaturation() {
return color.getSat2();
}
public void setSaturation(int saturation) {
color.setSat2(saturation);
}
public int getLuminance() {
return color.getLum2();
}
public void setLuminance(int lightness) {
color.setLum2(lightness);
}
}