Commit 3ce681f3 authored by Nico Mack's avatar Nico Mack

Switched definition of saturation from 0 <= x <=1 to 0 <= x <= 255

parent dd473e73
......@@ -82,6 +82,8 @@ public class BootstrappingUtils {
private static final String MILLIMETERS = "mm"; //$NON-NLS-1$
private static final String CAMERA = ""; //$NON-NLS-1$
private static final int TWO_POWER_EIGHT = 255;
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Primitives
......@@ -606,8 +608,8 @@ public class BootstrappingUtils {
if (rgbNode != null) {
int rgb = getContentAsInteger(colourNode, Externalization.RGB_COLOUR_NODE, BootstrappingUtils.MANDATORY, null, context);
String shade = getAttributeAsString(rgbNode, Externalization.SHADE_ATTRIBUTE, BootstrappingUtils.OPTIONAL, Externalization.EMPTY_STRING);
int alpha = getContentAsInteger(colourNode, Externalization.ALPHA_NODE, BootstrappingUtils.OPTIONAL, 255, context);
double saturation = getContentAsDouble(colourNode, Externalization.SATURATION_NODE, BootstrappingUtils.OPTIONAL, 1.0d, context);
int alpha = getContentAsInteger(colourNode, Externalization.ALPHA_NODE, BootstrappingUtils.OPTIONAL, TWO_POWER_EIGHT, context);
int saturation = getContentAsInteger(colourNode, Externalization.SATURATION_NODE, BootstrappingUtils.OPTIONAL, TWO_POWER_EIGHT, context);
rgb += alpha << 24;
colour = new Color(rgb, true); // With Alpha Channel
......@@ -621,8 +623,8 @@ public class BootstrappingUtils {
colour = colour.brighter().brighter();
}
if (saturation != 1.0d) {
colour = ColorFactory.changeColourSaturation(colour, saturation);
if (saturation != TWO_POWER_EIGHT) {
colour = ColorFactory.changeColourSaturation(colour, ((double) saturation / TWO_POWER_EIGHT));
}
} else {
String colourString = getContent(colourNode, Externalization.EMPTY_STRING, null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment