diff --git a/README.md b/README.md
index 2099d68f..897a0b5e 100644
--- a/README.md
+++ b/README.md
@@ -16,20 +16,21 @@ specifically how it handles color tinting with `setColor(float, float, float, fl
We address this in colorful by representing tint colors differently. While there's some support here for HSLC tints
(hue, saturation, lightness, contrast) via `Shaders.makeBatchHSLC()`, much more of the library focuses on four color
spaces: RGB, YCwCm, IPT, and Oklab. Most of this library's users will only employ one of these color spaces at a time,
-and the APIs for all the color spaces are extremely similar.
+and the APIs for all the color spaces are extremely similar. You most likely want to use RGB (because it is the most
+compatible with existing colors) and/or Oklab (because it is the most expressive and makes changing colors intuitive).
### RGB
RGB is familiar to almost everyone who works with color on computers; it has a red, a green, and a blue channel, plus
-alpha here. The difference between the way an RGB color tint works with a standard libGDX SpriteBatch and the way one
-works here is that a SpriteBatch is neutral at the value `(1.0, 1.0, 1.0, 1.0)` and can only reduce channels as they go
+alpha here. The difference between the way an RGB color tint works with a standard libGDX SpriteBatch, and the way one
+works here, is that a SpriteBatch is neutral at the value `(1.0, 1.0, 1.0, 1.0)` and can only reduce channels as they go
lower, while here, a ColorfulBatch is neutral at the value `(0.5, 0.5, 0.5, 1.0)` and can lower channels in the same way
or raise channels if they go above 0.5. Typically, RGB is used with the `com.github.tommyettinger.colorful.rgb` package,
with the `ColorfulBatch` class replacing `SpriteBatch`. The `ColorTools` class in the same package provides various
RGB-specific color manipulation, while `FloatColors` in the parent package provides non-specific manipulation of colors
as packed floats (which are the default here). `Palette` has 256 predefined colors from the DawnBringer Aurora palette,
which is well-distributed for almost any pixel art or digital painting, as packed floats that have substantial
-documentation; these colors can be accessed with their names via an ObjectFloatMap, `NAMED`, and those names in usefully'
+documentation. These colors can be accessed with their names via an ObjectFloatMap, `NAMED`, and those names in usefully
sorted orders as `NAMES_BY_LIGHTNESS` and `NAMES_BY_HUE`. There's also `SimplePalette`, which has fewer named colors
predefined, but allows specifying edited and/or combined colors using simple `String`s; more on that later.
@@ -39,7 +40,8 @@ int color, except that they never use or set one bit in alpha (so they really on
significant ones), and the RGBA bytes are in reversed order. The conversion from int color to packed float color is very
efficient thanks to how the JVM (and GWT, with a caveat) handle this operation. GWT, used for the HTML backend in
libGDX, actually defaults to a very slow conversion between int bits and float, but provides a way for libGDX (or other
-libraries) to convert quite efficiently; libGDX does this with its `NumberUtils` class.
+libraries) to convert quite efficiently; libGDX does this with its `NumberUtils` class. The `ColorTools` class in each
+color space's package provides many ways to manipulate and query packed floats.
`ColorfulBatch` doesn't just provide the option for tints to brighten and darken. It effectively has two batch colors;
one is multiplicative and is called the "tweak," while the regular color is now additive. The changes from the tweak can
@@ -58,6 +60,13 @@ least get a bit closer to a leafy background. Because libGDX's `Sprite` class de
color and its tweak, but otherwise can be treated like a Sprite. You can still use a `Sprite` with a `ColorfulBatch`,
you just can't set its tweak.
+If you don't want to use `ColorfulBatch`, then `Shaders` provides `ShaderProgram` generators and GLSL code for shaders
+that handle various color spaces. There are convenient functions that produce ShaderPrograms, like `makeRGBAShader()`
+and `makeGammaRGBAShader()`, from the GLSL sources `fragmentShaderRGBA` and `fragmentShaderGammaRGBA`, respectively.
+With these, you still use 50% gray as the neutral value, tinting with white brightens, and tinting with black eliminates
+all color. However, you don't have the "tweak" that `ColorfulBatch` has, so there's no contrast adjustment with this.
+You can use these `ShaderProgram`s with a standard `SpriteBatch`
+
### YCwCm
Instead of red, green, blue, and alpha channels, YCwCm uses luma (also called lightness), chromatic warmth, chromatic
@@ -157,17 +166,16 @@ introduced in [this recent blog post](https://bottosson.github.io/posts/oklab/),
between hue and the other aspects of color comparison. It has the components L (lightness), A (one chromatic channel,
roughly describing how cool or warm a color is, with high values closer to magenta and low values closer to green), and
B (the other chromatic channel, also in a sense describing something like cool to warm, but with high values closer to
-orange and low values closer to blue). It's like a slightly-rotated version of IPT, or YCwCm with the chromatic channels
-in reversed order. The main benefits of Oklab are for comparing colors, where you can use a standard Euclidean distance
-if you just halve L when measuring, and for making smooth gradients. It may also be a slight bit faster than IPT_HQ,
-even though its calculations are extremely similar, because Oklab uses a fast approximation of cube root when it's
-processed by Java, where IPT_HQ uses a slightly slower call to `Math.pow()` with 0.43 as the exponent. Going in reverse,
-Oklab can just do `n * n * n` where IPT_HQ needs to use `Math.pow()` again but also preserve the sign of its argument.
-This difference probably won't be noticeable in practice, since most color processing will be done on the GPU for the
-most intensive applications.
+orange and low values closer to blue). It's like a slightly-rotated version of IPT or YCwCm. The main benefits of Oklab
+are for comparing colors, where you can use a standard Euclidean distance, and for making smooth gradients. It may also
+be a slight bit faster than IPT_HQ, even though its calculations are extremely similar, because Oklab uses a fast
+approximation of cube root when it's processed by Java, where IPT_HQ uses a slightly slower call to `Math.pow()` with
+0.43 as the exponent. Going in reverse, Oklab can just do `n * n * n` where IPT_HQ needs to use `Math.pow()` again but
+also preserve the sign of its argument. This difference probably won't be noticeable in practice, since most color
+processing will be done on the GPU for the most intensive applications.
The `com.github.tommyettinger.colorful.oklab` package has parallels to all the classes in the `ipt_hq` package, which
-includes those in `ycwcm` and `ipt` as well.
+includes those in `ycwcm` and `ipt` as well. Its `SimplePalette` is particularly adept at smoothly changing colors.
### Describing Colors
@@ -183,6 +191,11 @@ colors in SimplePalette for Oklab can be previewed in
[this list by hue](https://tommyettinger.github.io/colorful-gdx/ColorTableSimpleHueOklab.html), or
[this list by lightness](https://tommyettinger.github.io/colorful-gdx/ColorTableSimpleValueOklab.html).
+You can use [this small libGDX web app](https://tommyettinger.github.io/colorful-gdx/description/) to experiment with
+different descriptions and what they produce. Use the `[` and `]` keys to change modes; there's an RGB, Oklab, IPT_HQ,
+and comparison mode. The comparison mode may be the most useful; it has 3 bars that change color using different color
+spaces and their SimplePalette transformations.
+
### HSLC
HSLC doesn't allow changing alpha, so it may be unsuitable for some tasks, but it does allow smooth hue rotations across
@@ -245,12 +258,12 @@ Using the Maven Central dependency is recommended, and Gradle and Maven can both
Gradle dependency (`implementation` should be changed to `api` if any other dependencies use `api`):
```groovy
-implementation 'com.github.tommyettinger:colorful:0.5.1'
+implementation 'com.github.tommyettinger:colorful:0.6.0'
```
Gradle dependency if also using GWT to make an HTML application:
```groovy
-implementation 'com.github.tommyettinger:colorful:0.5.1:sources'
+implementation 'com.github.tommyettinger:colorful:0.6.0:sources'
```
And also for GWT, in your application's `.gwt.xml` file (usually `GdxDefinition.gwt.xml`)
@@ -263,7 +276,7 @@ If you don't use Gradle, here's the Maven dependency:
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -347,10 +347,10 @@ ColorTools.ycwcm(float, float, float, float)
or
+ as from ColorTools.oklab(float, float, float, float)
or
ColorTools.ipt(float, float, float, float)
, and change can be
between 0f (keep start) and 1f (only use end). Both start and end should use the same color space; that is, both
- could be produced using YCwCm, both could be produced using IPT, or both could be libGDX-native RGB, but they
+ could be produced using Oklab, both could be produced using IPT, or both could be libGDX-native RGB, but they
can't mix. This is a good way to reduce allocations of temporary Colors.ColorTools.ycwcm(float, float, float, float)
or
- ColorTools.ipt(float, float, float, float)
, and change can be between 0f
- (keep start) and 1f (only use end). Both start and end should use the same color space; that is, both could be
- produced using YCwCm, or both could be produced using IPT, but not a mix of the two. This is a good way to
- reduce allocations of temporary Colors.ColorTools.ipt(float, float, float, float)
or
+ ColorTools.ycwcm(float, float, float, float)
, and change can
+ be between 0f (keep start) and 1f (only use end). Both start and end should use the same color space; that is,
+ both could be produced using IPT_HQ, or both could be produced using YCwCm, but not a mix of the two. This is a
+ good way to reduce allocations of temporary Colors.
start
- the starting color as a packed float; alpha will be preservedcolors
is null or has no items, this returns 0f (usually transparent in most color spaces).colors
is null or has no items, this returns 0f (usually transparent in most color spaces).
+ This is mostly useful in conjunction with FloatList
, using its items
+ for colors, typically 0 for offset, and its size
for size.colors
- an array or varargs of packed float colors; all should use the same color spacecolors
- an array of packed float colors; all should use the same color spaceoffset
- the index of the first item in colors
to usesize
- how many items from colors
to use_
suffix, like sin_(double)
, for turns to
@@ -256,33 +256,33 @@ static double
cos(double radians)
Math.cos(double)
that can be significantly faster (between 8x and 80x
+Math.cos(double)
that can be significantly faster (between 8x and 80x
faster cos() calls in benchmarking; if you have access to libGDX you should consider its sometimes-more-precise
and sometimes-faster MathUtils.cos() method.static float
cos(float radians)
Math.cos(double)
that can be significantly faster (between 8x and 80x
+Math.cos(double)
that can be significantly faster (between 8x and 80x
faster cos() calls in benchmarking, and both takes and returns floats; if you have access to libGDX you should
consider its more-precise and sometimes-faster MathUtils.cos() method.static double
cos_(double turns)
Math.cos(double)
that takes its input as a fraction of a turn instead of in radians; one
+Math.cos(double)
that takes its input as a fraction of a turn instead of in radians; one
turn is equal to 360 degrees or two*PI radians.static float
cos_(float turns)
Math.cos(double)
that takes its input as a fraction of a turn instead of in radians (it
+Math.cos(double)
that takes its input as a fraction of a turn instead of in radians (it
also takes and returns a float); one turn is equal to 360 degrees or two*PI radians.static float
cosDegrees(float degrees)
Math.cos(double)
that can be significantly faster (between 8x and 80x
+Math.cos(double)
that can be significantly faster (between 8x and 80x
faster cos() calls in benchmarking, and both takes and returns floats; if you have access to libGDX, you should
consider its more-precise and sometimes-faster MathUtils.cosDeg() method.static double
sin(double radians)
Math.sin(double)
that can be significantly faster (between 8x and 80x
+Math.sin(double)
that can be significantly faster (between 8x and 80x
faster sin() calls in benchmarking; if you have access to libGDX you should consider its sometimes-more-precise
and sometimes-faster MathUtils.sin() method.static float
sin(float radians)
Math.sin(double)
that can be significantly faster (between 8x and 80x
+Math.sin(double)
that can be significantly faster (between 8x and 80x
faster sin() calls in benchmarking, and both takes and returns floats; if you have access to libGDX you should
consider its more-precise and sometimes-faster MathUtils.sin() method.static double
sin_(double turns)
Math.sin(double)
that takes its input as a fraction of a turn instead of in radians; one
+Math.sin(double)
that takes its input as a fraction of a turn instead of in radians; one
turn is equal to 360 degrees or two*PI radians.static float
sin_(float turns)
Math.sin(double)
that takes its input as a fraction of a turn instead of in radians (it
+Math.sin(double)
that takes its input as a fraction of a turn instead of in radians (it
also takes and returns a float); one turn is equal to 360 degrees or two*PI radians.static float
sinDegrees(float degrees)
Math.sin(double)
that can be significantly faster (between 8x and 80x
+Math.sin(double)
that can be significantly faster (between 8x and 80x
faster sin() calls in benchmarking, and both takes and returns floats; if you have access to libGDX, you should
consider its more-precise and sometimes-faster MathUtils.sinDeg() method.clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Math.sin(double)
that can be significantly faster (between 8x and 80x
+Math.sin(double)
that can be significantly faster (between 8x and 80x
faster sin() calls in benchmarking; if you have access to libGDX you should consider its sometimes-more-precise
and sometimes-faster MathUtils.sin() method. Because this method doesn't rely on a
lookup table, where libGDX's MathUtils does, applications that have a bottleneck on memory may perform better
with this method than with MathUtils. Takes the same arguments Math.sin() does, so one angle in radians,
which may technically be any double (but this will lose precision on fairly large doubles, such as those that are
- larger than Long.MAX_VALUE
, because those doubles themselves will lose precision at that scale). This
+ larger than Long.MAX_VALUE
, because those doubles themselves will lose precision at that scale). This
is closely related to a cubic sway, but the shape of the output when graphed is almost identical to
- sin(). The difference between the result of this method and Math.sin(double)
should be under 0.0011 at
+ sin(). The difference between the result of this method and Math.sin(double)
should be under 0.0011 at
all points between -pi and pi, with an average difference of about 0.0005; not all points have been checked for
potentially higher errors, though.
Math.cos(double)
that can be significantly faster (between 8x and 80x
+Math.cos(double)
that can be significantly faster (between 8x and 80x
faster cos() calls in benchmarking; if you have access to libGDX you should consider its sometimes-more-precise
and sometimes-faster MathUtils.cos() method. Because this method doesn't rely on a
lookup table, where libGDX's MathUtils does, applications that have a bottleneck on memory may perform better
with this method than with MathUtils. Takes the same arguments Math.cos() does, so one angle in radians,
which may technically be any double (but this will lose precision on fairly large doubles, such as those that are
- larger than Long.MAX_VALUE
, because those doubles themselves will lose precision at that scale). This
+ larger than Long.MAX_VALUE
, because those doubles themselves will lose precision at that scale). This
is closely related to a cubic sway, but the shape of the output when graphed is almost identical to
- cos(). The difference between the result of this method and Math.cos(double)
should be under 0.0011 at
+ cos(). The difference between the result of this method and Math.cos(double)
should be under 0.0011 at
all points between -pi and pi, with an average difference of about 0.0005; not all points have been checked for
potentially higher errors, though.
Math.sin(double)
that can be significantly faster (between 8x and 80x
+Math.sin(double)
that can be significantly faster (between 8x and 80x
faster sin() calls in benchmarking, and both takes and returns floats; if you have access to libGDX you should
consider its more-precise and sometimes-faster MathUtils.sin() method. Because this method doesn't rely on a
lookup table, where libGDX's MathUtils does, applications that have a bottleneck on memory may perform better
with this method than with MathUtils. Takes the same arguments Math.sin() does, so one angle in radians,
which may technically be any float (but this will lose precision on fairly large floats, such as those that are
- larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). This
+ larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). This
is closely related to a cubic sway, but the shape of the output when graphed is almost identical to
- sin(). The difference between the result of this method and Math.sin(double)
should be under 0.0011 at
+ sin(). The difference between the result of this method and Math.sin(double)
should be under 0.0011 at
all points between -pi and pi, with an average difference of about 0.0005; not all points have been checked for
potentially higher errors, though.
Math.cos(double)
that can be significantly faster (between 8x and 80x
+Math.cos(double)
that can be significantly faster (between 8x and 80x
faster cos() calls in benchmarking, and both takes and returns floats; if you have access to libGDX you should
consider its more-precise and sometimes-faster MathUtils.cos() method. Because this method doesn't rely on a
lookup table, where libGDX's MathUtils does, applications that have a bottleneck on memory may perform better
with this method than with MathUtils. Takes the same arguments Math.cos() does, so one angle in radians,
which may technically be any float (but this will lose precision on fairly large floats, such as those that are
- larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). This
+ larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). This
is closely related to a cubic sway, but the shape of the output when graphed is almost identical to
- cos(). The difference between the result of this method and Math.cos(double)
should be under 0.0011 at
+ cos(). The difference between the result of this method and Math.cos(double)
should be under 0.0011 at
all points between -pi and pi, with an average difference of about 0.0005; not all points have been checked for
potentially higher errors, though.
Math.sin(double)
that can be significantly faster (between 8x and 80x
+Math.sin(double)
that can be significantly faster (between 8x and 80x
faster sin() calls in benchmarking, and both takes and returns floats; if you have access to libGDX, you should
consider its more-precise and sometimes-faster MathUtils.sinDeg() method. Because this method doesn't rely on a
lookup table, where libGDX's MathUtils does, applications that have a bottleneck on memory may perform better
with this method than with MathUtils. Takes one angle in degrees,
which may technically be any float (but this will lose precision on fairly large floats, such as those that are
- larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). The
- difference between the result of this method and Math.sin(double)
should be under 0.0011 at
+ larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). The
+ difference between the result of this method and Math.sin(double)
should be under 0.0011 at
all points between -360 and 360, with an average difference of about 0.0005; not all points have been checked for
potentially higher errors, though.
Math.cos(double)
that can be significantly faster (between 8x and 80x
+Math.cos(double)
that can be significantly faster (between 8x and 80x
faster cos() calls in benchmarking, and both takes and returns floats; if you have access to libGDX, you should
consider its more-precise and sometimes-faster MathUtils.cosDeg() method. Because this method doesn't rely on a
lookup table, where libGDX's MathUtils does, applications that have a bottleneck on memory may perform better
with this method than with MathUtils. Takes one angle in degrees,
which may technically be any float (but this will lose precision on fairly large floats, such as those that are
- larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). The
- difference between the result of this method and Math.cos(double)
should be under 0.0011 at
+ larger than Integer.MAX_VALUE
, because those floats themselves will lose precision at that scale). The
+ difference between the result of this method and Math.cos(double)
should be under 0.0011 at
all points between -360 and 360, with an average difference of about 0.0005; not all points have been checked for
potentially higher errors, though.
Math.sin(double)
that takes its input as a fraction of a turn instead of in radians; one
+Math.sin(double)
that takes its input as a fraction of a turn instead of in radians; one
turn is equal to 360 degrees or two*PI radians. This can be useful as a building block for other measurements;
to make a sine method that takes its input in grad (with 400 grad equal to 360 degrees), you would just divide
the grad value by 400.0 (or multiply it by 0.0025) and pass it to this method. Similarly for binary degrees, also
@@ -593,7 +593,7 @@ Math.cos(double)
that takes its input as a fraction of a turn instead of in radians; one
+Math.cos(double)
that takes its input as a fraction of a turn instead of in radians; one
turn is equal to 360 degrees or two*PI radians. This can be useful as a building block for other measurements;
to make a cosine method that takes its input in grad (with 400 grad equal to 360 degrees), you would just divide
the grad value by 400.0 (or multiply it by 0.0025) and pass it to this method. Similarly for binary degrees, also
@@ -623,7 +623,7 @@ Math.sin(double)
that takes its input as a fraction of a turn instead of in radians (it
+Math.sin(double)
that takes its input as a fraction of a turn instead of in radians (it
also takes and returns a float); one turn is equal to 360 degrees or two*PI radians. This can be useful as a
building block for other measurements; to make a sine method that takes its input in grad (with 400 grad equal to
360 degrees), you would just divide the grad value by 400.0 (or multiply it by 0.0025) and pass it to this
@@ -654,7 +654,7 @@ Math.cos(double)
that takes its input as a fraction of a turn instead of in radians (it
+Math.cos(double)
that takes its input as a fraction of a turn instead of in radians (it
also takes and returns a float); one turn is equal to 360 degrees or two*PI radians. This can be useful as a
building block for other measurements; to make a cosine method that takes its input in grad (with 400 grad equal
to 360 degrees), you would just divide the grad value by 400.0 (or multiply it by 0.0025) and pass it to this
@@ -687,7 +687,7 @@ Math.atan(double)
,
+ second-fastest and second-least precise). This method is usually much faster than Math.atan(double)
,
but is somewhat less precise than Math's implementation.Math.atan(double)
,
+ second-fastest and second-least precise). This method is usually much faster than Math.atan(double)
,
but is somewhat less precise than Math's implementation.Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
+ It is about 5 times faster than Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
Math, on Java 8 HotSpot). It is slightly faster than libGDX' MathUtils approximation of the same method;
MathUtils seems to have worse average error, though.
Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
+ It is about 5 times faster than Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
Math, on Java 8 HotSpot). It is slightly faster than libGDX' MathUtils approximation of the same method;
MathUtils seems to have worse average error, though.
Math.atan(double)
,
+ second-fastest and second-least precise). This method is usually much faster than Math.atan(double)
,
but is somewhat less precise than Math's implementation. This implementation can return negative or positive
results in degrees.Math.atan(double)
,
+ second-fastest and second-least precise). This method is usually much faster than Math.atan(double)
,
but is somewhat less precise than Math's implementation. This implementation can return negative or positive
results in degrees.Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
+ It is about 5 times faster than Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
Math, on Java 8 HotSpot). It is slightly faster than libGDX' MathUtils approximation of the same method;
MathUtils seems to have worse average error, as well.
Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
+ It is about 5 times faster than Math.atan2(double, double)
(roughly 12 ns instead of roughly 62 ns for
Math, on Java 8 HotSpot). It is slightly faster than libGDX' MathUtils approximation of the same method;
MathUtils seems to have worse average error, as well.
Math.asin(double)
, but is somewhat less
+ and least precise). This method is usually much faster than Math.asin(double)
, but is somewhat less
precise than Math's implementation. It is currently the same as libGDX's approximation in their MathUtils.Math.acos(double)
, but is somewhat less
+ and least precise). This method is usually much faster than Math.acos(double)
, but is somewhat less
precise than Math's implementation. It is currently the same as libGDX's approximation in their MathUtils.
Math.asin(double)
, but is somewhat less
+ and least precise). This method is usually much faster than Math.asin(double)
, but is somewhat less
precise than Math's implementation. It is currently the same as libGDX's approximation in their MathUtils, except
that this takes a double and returns a double.
Math.acos(double)
, but is somewhat less
+ and least precise). This method is usually much faster than Math.acos(double)
, but is somewhat less
precise than Math's implementation. It is currently the same as libGDX's approximation in their MathUtils, except
that this takes a double and returns a double.
int
and packed float
values in the IPT color space.
IPT has more perceptually-uniform handling of hue than some other color spaces, like YCwCm, and even
though the version here gives up the complex exponential adjustments to various components that the original IPT
@@ -162,6 +162,31 @@ start
closer to grayscale by change
(desaturating them).static float
editIPT(float encoded,
+ float addI,
+ float addP,
+ float addT,
+ float addAlpha)
static float
editIPT(float encoded,
+ float addI,
+ float addP,
+ float addT,
+ float addAlpha,
+ float mulI,
+ float mulP,
+ float mulT,
+ float mulAlpha)
static float
enrich(float start,
float change)
static float
randomColor(Random random)
randomColor(Random random)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encoded
- a packed float IPT coloraddI
- how much to add to the intensity channel; typically in the -1 to 1 rangeaddP
- how much to add to the protan channel; typically in the -2 to 2 rangeaddT
- how much to add to the tritan channel; typically in the -2 to 2 rangeaddAlpha
- how much to add to the alpha channel; typically in the -1 to 1 rangeencoded
mulI
, then has addI
added, and
+ then is clamped to the normal range for intensity (0 to 1). This returns a different float value (of course, the
+ given float can't be edited in-place). You can give a value of 0 for any "add" parameter you want to stay
+ unchanged, or a value of 1 for any "mul" parameter that shouldn't change. Note that this manipulates protan and
+ tritan in the -1 to 1 range, so if you multiply by a small number like 0.25f
, then this will produce a
+ less-saturated color, and if you multiply by a larger number like 4f
, then you will get a much
+ more-saturated color. This clamps the resulting color to remain in-gamut, so it should be safe to convert it back
+ to RGBA.encoded
- a packed float IPT coloraddI
- how much to add to the intensity channel; typically in the -1 to 1 rangeaddP
- how much to add to the protan channel; typically in the -2 to 2 rangeaddT
- how much to add to the tritan channel; typically in the -2 to 2 rangeaddAlpha
- how much to add to the alpha channel; typically in the -1 to 1 rangemulI
- how much to multiply the intensity channel by; should be non-negativemulP
- how much to multiply the protan channel by; usually non-negative (not always)mulT
- how much to multiply the tritan channel by; usually non-negative (not always)mulAlpha
- how much to multiply the alpha channel by; should be non-negativeencoded
randomColor(Random)
but for cases where you already have three floats (r, g, and b)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt/Palette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt/Palette.html
index c618113f..203991ed 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt/Palette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt/Palette.html
@@ -3,7 +3,7 @@
-ColorTools
works with.
You can access colors by their constant name, such as OCEAN_BLUE
, by the NAMED
map using
NAMED.get("Ocean Blue", 0f)
, or by index in the FloatArray called LIST
. Note that to access a float
@@ -837,21 +837,21 @@ B1B10AFF
, intensity 0.5411765, protan 0.4745098, tritan 0.80784315, alpha 1.0, hue 0.16913939, and saturation 0.6568773.static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
NAMED
.NAMED
.NAMED
.int
and packed float
values in the IPT color space.
IPT has more perceptually-uniform handling of hue than some other color spaces, like YCwCm, and this version goes
further than the IPT package
by performing gamma correction and all the
@@ -162,6 +162,31 @@ start
closer to grayscale by change
(desaturating them).static float
editIPT(float encoded,
+ float addI,
+ float addP,
+ float addT,
+ float addAlpha)
static float
editIPT(float encoded,
+ float addI,
+ float addP,
+ float addT,
+ float addAlpha,
+ float mulI,
+ float mulP,
+ float mulT,
+ float mulAlpha)
static float
enrich(float start,
float change)
static float
limitToGamut(float packed)
static float
static float
static float
static float
randomColor(Random random)
randomColor(Random random)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
packed
- a packed float color in IPT format; often this color is not in-gamutYou can use inGamut() if you just want to check whether a color is in-gamut.
i
- intensity component; will be clamped between 0 and 1 if it isn't alreadyp
- protan component; will be clamped between 0 and 1 if it isn't alreadyt
- tritan component; will be clamped between 0 and 1 if it isn't alreadyYou can use inGamut() if you just want to check whether a color is in-gamut.
i
- intensity component; will be clamped between 0 and 1 if it isn't alreadyt
- tritan component; will be clamped between 0 and 1 if it isn't alreadya
- alpha component; will be clamped between 0 and 1 if it isn't alreadyYou can use inGamut() if you just want to check whether a color is in-gamut.
encoded
- a packed float IPT_HQ coloraddI
- how much to add to the intensity channel; typically in the -1 to 1 rangeaddP
- how much to add to the protan channel; typically in the -2 to 2 rangeaddT
- how much to add to the tritan channel; typically in the -2 to 2 rangeaddAlpha
- how much to add to the alpha channel; typically in the -1 to 1 rangeencoded
mulI
, then has addI
added, and
+ then is clamped to the normal range for intensity (0 to 1). This returns a different float value (of course, the
+ given float can't be edited in-place). You can give a value of 0 for any "add" parameter you want to stay
+ unchanged, or a value of 1 for any "mul" parameter that shouldn't change. Note that this manipulates protan and
+ tritan in the -1 to 1 range, so if you multiply by a small number like 0.25f
, then this will produce a
+ less-saturated color, and if you multiply by a larger number like 4f
, then you will get a much
+ more-saturated color. This clamps the resulting color to remain in-gamut, so it should be safe to convert it back
+ to RGBA.encoded
- a packed float IPT_HQ coloraddI
- how much to add to the intensity channel; typically in the -1 to 1 rangeaddP
- how much to add to the protan channel; typically in the -2 to 2 rangeaddT
- how much to add to the tritan channel; typically in the -2 to 2 rangeaddAlpha
- how much to add to the alpha channel; typically in the -1 to 1 rangemulI
- how much to multiply the intensity channel by; should be non-negativemulP
- how much to multiply the protan channel by; usually non-negative (not always)mulT
- how much to multiply the tritan channel by; usually non-negative (not always)mulAlpha
- how much to multiply the alpha channel by; should be non-negativeencoded
ColorTools
works with.
You can access colors by their constant name, such as OCEAN_BLUE
, by the NAMED
map using
NAMED.get("Ocean Blue", 0f)
, or by index in the FloatArray called LIST
. Note that to access a float
@@ -837,21 +837,21 @@ B1B10AFF
, intensity 0.627451, protan 0.45882353, tritan 0.7372549, alpha 1.0, hue 0.16808262, and saturation 0.6667582.static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
NAMED
.NAMED
.NAMED
.ColorTools
works with.
You can access colors by their constant name, such as OCEAN_BLUE
, by the NAMED
map using
NAMED.get("Ocean Blue", 0f)
, or by index in the FloatArray called LIST
. Note that to access a float
@@ -103,7 +103,7 @@ static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
NAMED
, like "grey" as an alias for GRAY
or "gold" as an
@@ -254,23 +254,23 @@ 204608FF
, intensity 0.25882354, protan 0.4392157, tritan 0.5882353, alpha 1.0, hue 0.27203476, and saturation 0.241091.static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static com.github.tommyettinger.ds.ObjectList<String>
static String
static String
bestMatch(float ipt_hq,
int mixCount)
mixCount
colors to mix in.static float
parseDescription(String description)
parseDescription(String description)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
NAMED
, like "grey" as an alias for GRAY
or "gold" as an
alias for SAFFRON
. Currently, the list of aliases is as follows:
NAMED
.NAMED
.NAMED
.mixCount
colors to mix in. You should only use small numbers for mixCount, like 1 to 3;
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt_hq/class-use/ColorTools.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt_hq/class-use/ColorTools.html
index 7b87012c..a21809be 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt_hq/class-use/ColorTools.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/ipt_hq/class-use/ColorTools.html
@@ -3,7 +3,7 @@
-int
and packed float
values in the Oklab color space.
Oklab is a very new color space that builds on the same foundation as IPT, but seems to be better-calibrated for
uniform lightness and colorfulness, instead of just the emphasis on uniform hue that IPT has. Relative to IPT, Oklab
@@ -171,191 +171,255 @@ static float
darken(float start,
- float change)
chromaLimit(float hue,
+ float lightness)
static float
differentiateLightness(float mainColor,
- float contrastingColor)
darken(float start,
+ float change)
static float
differentiateLightness(float mainColor,
+ float contrastingColor)
mainColor
and another Oklab color that it should be made to contrast
with, gets a packed float Oklab color with L that should be quite different from contrastingColor
's L,
but the same chromatic channels and opacity (A and B are likely to be clamped if the result gets close to white
or black).static float
dullen(float start,
+static float
+dullen(float start,
float change)
-
+
Brings the chromatic components of start
closer to grayscale by change
(desaturating them).
+static float
+editOklab(float encoded,
+ float addL,
+ float addA,
+ float addB,
+ float addAlpha)
+
+Given a packed float Oklab color, this edits its L, A, B, and alpha channels by adding the corresponding "add"
+ parameter and then clamping.
+
static float
-enrich(float start,
- float change)
+editOklab(float encoded,
+ float addL,
+ float addA,
+ float addB,
+ float addAlpha,
+ float mulL,
+ float mulA,
+ float mulB,
+ float mulAlpha)
-Pushes the chromatic components of start
away from grayscale by change (saturating them).
+Given a packed float Oklab color, this edits its L, A, B, and alpha channels by first multiplying each channel by
+ the corresponding "mul" parameter and then adding the corresponding "add" parameter, before clamping.
static float
-fade(float start,
+enrich(float start,
float change)
-Interpolates from the packed float color start towards transparent by change.
+Pushes the chromatic components of start
away from grayscale by change (saturating them).
static float
-floatGetHSL(float hue,
+fade(float start,
+ float change)
+
+Interpolates from the packed float color start towards transparent by change.
+
+static float
+floatGetHSL(float hue,
float saturation,
float lightness,
float opacity)
-
+
Gets a color as an Oklab packed float given floats representing hue, saturation, lightness, and opacity.
-static float
-fromRGBA(float packed)
-
+static float
+fromRGBA(float packed)
+
Takes a color encoded as an RGBA8888 packed float and converts to a packed float in the Oklab format this uses.
-static float
-fromRGBA(float r,
+static float
+fromRGBA(float r,
float g,
float b,
float a)
-
+
Takes RGBA components from 0.0 to 1.0 each and converts to a packed float in the Oklab format this uses.
-static float
-fromRGBA8888(int rgba)
-
+static float
+fromRGBA8888(int rgba)
+
Takes a color encoded as an RGBA8888 int and converts to a packed float in the Oklab format this uses.
-static byte
-getRawGamutValue(int index)
-
+static byte
+getRawGamutValue(int index)
+
Given a 1D int index between 0 and 65535 (both inclusive), this treats the 1D index as two parts (lightness and
hue angle, both from 0 to 255) and gets the distance from grayscale to the edge of the gamut at that lightness
and hue.
-static float
-green(float encoded)
-
+static float
+green(float encoded)
+
Gets the green channel value of the given encoded color, as a float from 0.0f to 1.0f, inclusive.
-static int
-greenInt(float encoded)
-
+static int
+greenInt(float encoded)
+
Gets the green channel value of the given encoded color, as an int ranging from 0 to 255, inclusive.
-static float
-hue(float encoded)
-
+static float
+hue(float encoded)
+
Gets the hue of the given encoded color, as a float from 0f (inclusive, red and approaching orange if increased)
to 1f (exclusive, red and approaching purple if decreased).
-static boolean
-inGamut(float packed)
-
+static boolean
+inGamut(float packed)
+
Returns true if the given packed float color, as Oklab, is valid to convert losslessly back to RGBA.
-static boolean
-inGamut(float L,
+static boolean
+inGamut(float L,
float A,
float B)
-
+
Returns true if the given Oklab values are valid to convert losslessly back to RGBA.
-static float
-inverseLightness(float mainColor,
+static float
+inverseLightness(float mainColor,
float contrastingColor)
-
+
Given a packed float Oklab color mainColor
and another Oklab color that it should be made to contrast with,
gets a packed float Oklab color with roughly inverted L but the same chromatic channels and opacity (A and B
are likely to be clamped if the result gets close to white or black).
-static float
-lessenChange(float color,
+static float
+lessenChange(float color,
float fraction)
-
+
Makes the additive Oklab color stored in color
cause less of a change when used as a tint, as if it were
mixed with neutral gray.
-static float
-lighten(float start,
- float change)
-
-Interpolates from the packed float color start towards white by change.
-
static float
-lightness(float encoded)
+lighten(float start,
+ float change)
-Defined as per HSL; normally you only need channelL(float)
to get accurate lightness for Oklab.
+Interpolates from the packed float color start towards white by change.
static float
-limitToGamut(float packed)
+lightness(float encoded)
-Checks whether the given Oklab color is in-gamut; if it isn't in-gamut, brings the color just inside
- the gamut at the same lightness, or if it is already in-gamut, returns the color as-is.
+Defined as per HSL; normally you only need channelL(float)
to get accurate lightness for Oklab.
static float
-limitToGamut(float L,
- float A,
- float B)
+limitToGamut(float packed)
Checks whether the given Oklab color is in-gamut; if it isn't in-gamut, brings the color just inside
the gamut at the same lightness, or if it is already in-gamut, returns the color as-is.
static float
-limitToGamut(float L,
+limitToGamut(float L,
float A,
- float B,
- float alpha)
+ float B)
Checks whether the given Oklab color is in-gamut; if it isn't in-gamut, brings the color just inside
the gamut at the same lightness, or if it is already in-gamut, returns the color as-is.
static float
-lowerA(float start,
- float change)
+limitToGamut(float L,
+ float A,
+ float B,
+ float alpha)
-Interpolates from the packed float color start towards a cooler color (green to blue) by change.
+Checks whether the given Oklab color is in-gamut; if it isn't in-gamut, brings the color just inside
+ the gamut at the same lightness, or if it is already in-gamut, returns the color as-is.
static float
-lowerB(float start,
+lowerA(float start,
float change)
-Interpolates from the packed float color start towards an "artificial" color (between blue and purple) by change.
+Interpolates from the packed float color start towards a cooler color (green to blue) by change.
static float
-maximizeSaturation(float packed)
+lowerB(float start,
+ float change)
+Interpolates from the packed float color start towards an "artificial" color (between blue and purple) by change.
+
+static float
+maximizeSaturation(float packed)
+
Gets the color with the same L as the Oklab color stored in the given packed float, but the furthest A
B from gray possible for that lightness while keeping the same hue as the given color.
-static float
-maximizeSaturation(float L,
+static float
+maximizeSaturation(float L,
float A,
float B,
float alpha)
-
+
Gets the color with the same L as the Oklab color stored in the given packed float, but the furthest A
B from gray possible for that lightness while keeping the same hue as the given color.
-static float
-offsetLightness(float mainColor)
-
+static float
+offsetLightness(float mainColor)
+
Pretty simple; adds 0.5 to the given color's L and wraps it around if it would go above 1.0, then averages that
with the original L.
-static float
-oklab(float l,
+static float
+oklab(float l,
float a,
float b,
float alpha)
-
+
Gets a packed float representation of a color given as 4 float components, here, L (luminance or lightness), A
(a chromatic component ranging from greenish to reddish, called protan in IPT), B (a chromatic component ranging
from bluish to yellowish, called tritan in IPT), and alpha (or opacity).
+static float
+oklabByHCL(float hue,
+ float chroma,
+ float lightness,
+ float alpha)
+
+A different way to specify an Oklab color, using hue, chroma, lightness, and alpha something like a normal HSL(A)
+ color but calculating them directly in the Oklab color space.
+
+static float
+oklabByHSL(float hue,
+ float saturation,
+ float lightness,
+ float alpha)
+
+A different way to specify an Oklab color, using hue, saturation, lightness, and alpha like a normal HSL(A) color
+ but calculating them directly in the Oklab color space.
+
+static float
+oklabHue(float packed)
+
+Gets the hue of the given Oklab float color, but as Oklab understands hue rather than how HSL does.
+
+static float
+oklabLightness(float packed)
+
+Gets the lightness of the given Oklab float color, but as Oklab understands lightness rather than how HSL does.
+
+static float
+oklabSaturation(float packed)
+
+Gets the saturation of the given Oklab float color, but as Oklab understands saturation rather than how HSL does.
+
static float
raiseA(float start,
float change)
@@ -369,7 +433,7 @@ Method Summary
Interpolates from the packed float color start towards a "natural" color (between green and orange) by change.
static float
-randomColor(Random random)
+randomColor(Random random)
Produces a random packed float color that is always in-gamut (and opaque) and should be uniformly distributed.
@@ -422,8 +486,8 @@ Method Summary
-Methods inherited from class java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -438,7 +502,7 @@ Constructor Details
-
ColorTools
-public ColorTools()
+public ColorTools()
@@ -452,7 +516,7 @@ Method Details
-
oklab
-public static float oklab(float l,
+
@@ -488,7 +552,7 @@ oklab
-
toRGBA8888
-
+
Converts a packed float color in the format produced by oklab(float, float, float, float)
to an RGBA8888 int.
This format of int can be used with Pixmap and in some other places in libGDX.
@@ -502,7 +566,7 @@ toRGBA8888
-
toRGBA
-
+
Converts a packed float color in the format produced by oklab(float, float, float, float)
to a packed float in RGBA format.
This format of float can be used with the standard SpriteBatch and in some other places in libGDX.
@@ -517,7 +581,7 @@ toRGBA
-
fromRGBA8888
-
+
Takes a color encoded as an RGBA8888 int and converts to a packed float in the Oklab format this uses.
- Parameters:
@@ -530,7 +594,7 @@ fromRGBA8888
-
fromRGBA
-
+
Takes a color encoded as an RGBA8888 packed float and converts to a packed float in the Oklab format this uses.
- Parameters:
@@ -543,7 +607,7 @@ fromRGBA
-
fromRGBA
-public static float fromRGBA(float r,
+
@@ -562,7 +626,7 @@ fromRGBA
-
redInt
-
+
Gets the red channel value of the given encoded color, as an int ranging from 0 to 255, inclusive.
- Parameters:
@@ -575,7 +639,7 @@ redInt
-
greenInt
-
+
Gets the green channel value of the given encoded color, as an int ranging from 0 to 255, inclusive.
- Parameters:
@@ -588,7 +652,7 @@ greenInt
-
blueInt
-
+
Gets the blue channel value of the given encoded color, as an int ranging from 0 to 255, inclusive.
- Parameters:
@@ -601,7 +665,7 @@ blueInt
-
alphaInt
-
+
Gets the alpha channel value of the given encoded color, as an even int ranging from 0 to 254, inclusive. Because
of how alpha is stored in libGDX, no odd-number values are possible for alpha.
@@ -615,7 +679,7 @@ alphaInt
-
red
-
+
Gets the red channel value of the given encoded color, as a float from 0.0f to 1.0f, inclusive.
- Parameters:
@@ -628,7 +692,7 @@ red
-
green
-
+
Gets the green channel value of the given encoded color, as a float from 0.0f to 1.0f, inclusive.
- Parameters:
@@ -641,7 +705,7 @@ green
-
blue
-
+
Gets the blue channel value of the given encoded color, as a float from 0.0f to 1.0f, inclusive.
- Parameters:
@@ -654,7 +718,7 @@ blue
-
alpha
-
+
Gets the alpha channel value of the given encoded color, as a float from 0.0f to 1.0f, inclusive.
- Parameters:
@@ -667,27 +731,44 @@ alpha
-
chroma
-
+
Gets the "chroma" or "colorfulness" of a given Oklab color. Chroma is similar to saturation in that grayscale
values have 0 saturation and 0 chroma, while brighter colors have high saturation and chroma. The difference is
- that colors that are perceptually more-colorful have higher chroma that colors that are perceptually
- less-colorful, regardless of hue, whereas saturation changes its range depending on how colorful a value can be
- at its hue. That is, the most saturated color always has a saturation of 1, but if that color isn't perceptually
- very colorful, it could have a chroma that is somewhat lower than 1. I don't yet know the range of this function,
- other than it can't be negative, grayscale values have 0 chroma, and the most colorful values should be near 1,
- maybe as high as the square root of 2.
+ that colors that are perceptually more-colorful have higher chroma than colors that are perceptually
+ less-colorful, regardless of hue, whereas saturation changes its meaning depending on the hue and lightness. That
+ is, the most saturated color for a given hue and lightness always has a saturation of 1, but if that color
+ isn't perceptually very colorful (as is the case for very dark and very light colors), it will have a chroma that
+ is much lower than the maximum. The result of this method can't be negative, grayscale values have very close to
+ 0 chroma, and the most colorful values (all very close to magenta) should have 0.31613f chroma.
- Parameters:
encoded
- a color as a packed float that can be obtained by oklab(float, float, float, float)
- Returns:
-- a non-negative float that represents how colorful the given value is
+- a float between 0.0f and 0.31613f that represents how colorful the given value is
+
+
+
+-
+
+chromaLimit
+
+Given a hue and lightness, this gets the (approximate) maximum chroma possible for that hue-lightness
+ combination. This is useful to know the bounds of chroma(float)
. This should be no greater
+ than 0.31613f .
+
+- Parameters:
+hue
- the hue, typically between 0.0f and 1.0f, to look up
+lightness
- the lightness, clamped between 0.0f and 1.0f, to look up
+- Returns:
+- the maximum possible chroma for the given hue and lightness, between 0.0f and 0.31613f
-
floatGetHSL
-public static float floatGetHSL(float hue,
+
@@ -698,7 +779,15 @@ floatGetHSL
a saturation of 1 is brightly colored, and values close to 1 will usually appear more distinct than values close
to 0, especially if the hue is different. A lightness of 0.001f or less is always black (also using a shortcut if
this is the case, respecting opacity), while a lightness of 1f is white. Very bright colors are mostly in a band
- of high-saturation where lightness is 0.5f.
+ of high-saturation where lightness is 0.5f.
+
+ This method considers its hue, saturation, and lightness parameters as the HSL color space does. You may instead
+ want the method oklabByHSL(float, float, float, float)
, which treats lightness exactly as Oklab does,
+ and handles hue and saturation with the Oklab color solid (which is shaped oddly) instead of the HSL color solid
+ (which is a bicone, with a wide cone pointing up attached at the base to another wide cone pointing down).
+ Using oklabByHSL() should be faster in many cases, and the lightness handling alone may be a reason to use it.
+ There is also oklabByHCL(float, float, float, float)
, which may be preferable if you want a specific
+ amount of chroma (colorful-ness) and no greater.
- Parameters:
hue
- 0f to 1f, color wheel position
@@ -713,9 +802,11 @@ floatGetHSL
-
saturation
-
+
Gets the saturation of the given encoded color as HSL would calculate it, as a float ranging from 0.0f to 1.0f,
- inclusive. This is different from chroma(float)
; see that method's documentation for details.
+ inclusive. This is different from chroma(float)
; see that method's documentation for details. It is also
+ different from oklabSaturation(float)
, which gets the saturation as Oklab understands it rather than how
+ HSL understands it.
- Parameters:
encoded
- a color as a packed float that can be obtained by oklab(float, float, float, float)
@@ -727,9 +818,10 @@ saturation
-
lightness
-
-Defined as per HSL; normally you only need channelL(float)
to get accurate lightness for Oklab.
- This ranges from 0.0f (black) to 1.0f (white).
+
+Defined as per HSL; normally you only need channelL(float)
to get accurate lightness for Oklab. You can
+ also use oklabLightness(float)
, which is an alias for channelL(). This ranges from 0.0f (black) to 1.0f
+ (white).
- Parameters:
encoded
- a packed float Oklab color
@@ -741,9 +833,11 @@ lightness
-
hue
-
+
Gets the hue of the given encoded color, as a float from 0f (inclusive, red and approaching orange if increased)
- to 1f (exclusive, red and approaching purple if decreased).
+ to 1f (exclusive, red and approaching purple if decreased). You can also use oklabHue(float)
, which
+ positions the different hues at different values, somewhat, from this, but is more accurate to how Oklab handles
+ hues.
- Parameters:
encoded
- a color as a packed float that can be obtained by oklab(float, float, float, float)
@@ -756,7 +850,7 @@ hue
-
channelL
-
+
The "L" channel of the given packed float in Oklab format, which is its lightness; ranges from 0.0f to
1.0f . You can edit the L of a color with lighten(float, float)
and darken(float, float)
.
@@ -770,7 +864,7 @@ channelL
-
channelA
-
+
The "A" channel of the given packed float in Oklab format, which when combined with the B channel describes the
hue and saturation of a color; ranges from 0f to 1f . If A is 0f, the color will be cooler, more green or
blue; if A is 1f, the color will be warmer, from magenta to orange. You can edit the A of a color with
@@ -786,7 +880,7 @@ channelA
-
channelB
-
+
The "B" channel of the given packed float in Oklab format, which when combined with the A channel describes the
hue and saturation of a color; ranges from 0f to 1f . If B is 0f, the color will be more "artificial", more
blue or purple; if B is 1f, the color will be more "natural", from green to yellow to orange. You can edit
@@ -802,7 +896,7 @@ channelB
-
toEditedFloat
-public static float toEditedFloat(float basis,
+public static float toEditedFloat(float basis,
float hue,
float saturation,
float light,
@@ -818,7 +912,10 @@ toEditedFloat
can't go above 1 or below 0, with an exception for hue, which can rotate around if lower or higher hues would be
used. As an example, if you give this 0.4f for saturation, and the current color has saturation 0.7f, then the
resulting color will have 1f for saturation. If you gave this -0.1f for saturation and the current color again
- has saturation 0.7f, then resulting color will have 0.6f for saturation.
+ has saturation 0.7f, then resulting color will have 0.6f for saturation.
+
+ You may want editOklab(float, float, float, float, float, float, float, float, float)
instead, which
+ adjusts the L, A, B, and alpha channels directly instead of converting to HSL and back.
- Parameters:
basis
- a packed float color that will be used as the starting point to make the next color
@@ -834,7 +931,7 @@ toEditedFloat
-
lighten
-public static float lighten(float start,
+
Interpolates from the packed float color start towards white by change. While change should be between 0f (return
start as-is) and 1f (return white), start should be a packed color, as from
@@ -855,7 +952,7 @@ lighten
-
darken
-public static float darken(float start,
+
Interpolates from the packed float color start towards black by change. While change should be between 0f (return
start as-is) and 1f (return black), start should be a packed color, as from
@@ -876,7 +973,7 @@ darken
-
raiseA
-public static float raiseA(float start,
+
Interpolates from the packed float color start towards a warmer color (orange to magenta) by change. While change
should be between 0f (return start as-is) and 1f (return fully warmed), start should be a packed color, as from
@@ -898,7 +995,7 @@ raiseA
-
lowerA
-public static float lowerA(float start,
+
Interpolates from the packed float color start towards a cooler color (green to blue) by change. While change
should be between 0f (return start as-is) and 1f (return fully cooled), start should be a packed color, as from
@@ -920,7 +1017,7 @@ lowerA
-
raiseB
-public static float raiseB(float start,
+
Interpolates from the packed float color start towards a "natural" color (between green and orange) by change.
While change should be between 0f (return start as-is) and 1f (return fully natural), start should be a packed color, as
@@ -942,7 +1039,7 @@ raiseB
-
lowerB
-public static float lowerB(float start,
+
Interpolates from the packed float color start towards an "artificial" color (between blue and purple) by change.
While change should be between 0f (return start as-is) and 1f (return fully artificial), start should be a packed color, as
@@ -964,7 +1061,7 @@ lowerB
-
blot
-public static float blot(float start,
+
Interpolates from the packed float color start towards that color made opaque by change. While change should be
between 0f (return start as-is) and 1f (return start with full alpha), start should be a packed color, as from
@@ -985,7 +1082,7 @@ blot
-
fade
-public static float fade(float start,
+
Interpolates from the packed float color start towards transparent by change. While change should be between 0
(return start as-is) and 1f (return the color with 0 alpha), start should be a packed color, as from
@@ -1006,7 +1103,7 @@ fade
-
dullen
-public static float dullen(float start,
+
Brings the chromatic components of start
closer to grayscale by change
(desaturating them). While
change should be between 0f (return start as-is) and 1f (return fully gray), start should be a packed color, as
@@ -1026,7 +1123,7 @@ dullen
-
enrich
-public static float enrich(float start,
+
Pushes the chromatic components of start
away from grayscale by change (saturating them). While change
should be between 0f (return start as-is) and 1f (return maximally saturated), start should be a packed color, as
@@ -1048,7 +1145,7 @@ enrich
-
inverseLightness
-public static float inverseLightness(float mainColor,
+
Given a packed float Oklab color mainColor
and another Oklab color that it should be made to contrast with,
gets a packed float Oklab color with roughly inverted L but the same chromatic channels and opacity (A and B
@@ -1074,7 +1171,7 @@ inverseLightness
-
differentiateLightness
-public static float differentiateLightness(float mainColor,
+
Given a packed float Oklab color mainColor
and another Oklab color that it should be made to contrast
with, gets a packed float Oklab color with L that should be quite different from contrastingColor
's L,
@@ -1097,7 +1194,7 @@ differentiateLightness
-
offsetLightness
-
+
Pretty simple; adds 0.5 to the given color's L and wraps it around if it would go above 1.0, then averages that
with the original L. This means light colors become darker, and dark colors become lighter, with almost all
results in the middle-range of possible lightness.
@@ -1112,7 +1209,7 @@ offsetLightness
-
lessenChange
-public static float lessenChange(float color,
+
Makes the additive Oklab color stored in color
cause less of a change when used as a tint, as if it were
mixed with neutral gray. When fraction
is 1.0, this returns color unchanged; when fraction is 0.0, it
@@ -1130,7 +1227,7 @@ lessenChange
-
randomEdit
-public static float randomEdit(float color,
+
Makes a quasi-randomly-edited variant on the given color
, allowing typically a small amount of
@@ -1154,7 +1251,7 @@ randomEdit
-
getRawGamutValue
-
+
Given a 1D int index between 0 and 65535 (both inclusive), this treats the 1D index as two parts (lightness and
hue angle, both from 0 to 255) and gets the distance from grayscale to the edge of the gamut at that lightness
and hue. The index can be constructed from a lightness value L
from 0 to 255, and a hue value H
@@ -1187,7 +1284,7 @@ getRawGamutValue
-
inGamut
-
+
Returns true if the given packed float color, as Oklab, is valid to convert losslessly back to RGBA.
- Parameters:
@@ -1200,7 +1297,7 @@ inGamut
-
inGamut
-public static boolean inGamut(float L,
+
Returns true if the given Oklab values are valid to convert losslessly back to RGBA.
@@ -1217,7 +1314,7 @@ inGamut
-
maximizeSaturation
-
+
Gets the color with the same L as the Oklab color stored in the given packed float, but the furthest A
B from gray possible for that lightness while keeping the same hue as the given color. This is very
similar to calling enrich(float, float)
with a very large change
value.
@@ -1234,7 +1331,7 @@ maximizeSaturation
-
maximizeSaturation
-public static float maximizeSaturation(float L,
+
@@ -1255,9 +1352,120 @@ maximizeSaturation
-
+
+oklabHue
+
+Gets the hue of the given Oklab float color, but as Oklab understands hue rather than how HSL does.
+ This is different from hue(float)
, which uses HSL. This gives a float between 0 (inclusive)
+ and 1 (exclusive).
+
+- Parameters:
+packed
- a packed Oklab float color
+- Returns:
+- a float between 0 (inclusive) and 1 (exclusive) that represents hue in the Oklab color space
+
+
+
+-
+
+oklabSaturation
+
+Gets the saturation of the given Oklab float color, but as Oklab understands saturation rather than how HSL does.
+ Saturation here is a fraction of the chroma limit (see chromaLimit(float, float)
) for a given hue and
+ lightness, and is between 0 and 1. This gives a float between 0 (inclusive) and 1 (inclusive).
+
+- Parameters:
+packed
- a packed Oklab float color
+- Returns:
+- a float between 0 (inclusive) and 1 (inclusive) that represents saturation in the Oklab color space
+
+
+
+-
+
+oklabLightness
+
+Gets the lightness of the given Oklab float color, but as Oklab understands lightness rather than how HSL does.
+ This is different from lightness(float)
, which uses HSL. This gives a float between 0 (inclusive)
+ and 1 (inclusive).
+
+ This is the same as channelL(float)
.
+
+- Parameters:
+packed
- a packed Oklab float color
+- Returns:
+- a float between 0 (inclusive) and 1 (inclusive) that represents lightness in the Oklab color space
+
+
+
+-
+
+oklabByHSL
+
+A different way to specify an Oklab color, using hue, saturation, lightness, and alpha like a normal HSL(A) color
+ but calculating them directly in the Oklab color space. This is more efficient than
+ floatGetHSL(float, float, float, float)
, but for colors with less than 0.5f lightness, it can be very
+ unpredictable in how it handles saturation. Most colors between 0.5 and 0.75 hue that also have less than 0.5
+ lightness are extremely desaturated and close to gray, regardless of what you give for saturation, and these
+ colors suddenly jump to very saturated around 0.75 hue and higher. To avoid this issue, you may prefer using
+ oklabByHCL(float, float, float, float)
, which takes an absolute chroma as opposed to the saturation here
+ (which is a fraction of the maximum chroma).
+
+ Note that this takes a different value for its hue
that the method hue(float)
produces, just
+ like its saturation
and the method saturation(float)
, and lightness
and the method
+ lightness(float)
. The hue is just distributed differently, and the lightness should be equivalent to
+ channelL(float)
, but the saturation here refers to what fraction the chroma should be of the maximum
+ chroma for the given hue and lightness. You can use oklabHue(float)
, oklabSaturation(float)
,
+ and oklabLightness(float)
to get the hue, saturation, and lightness values from an existing color that
+ this will understand (alpha(float)
too).
+
+- Parameters:
+hue
- between 0 and 1, usually, but this will automatically wrap if too high or too low
+saturation
- will be clamped between 0 and 1
+lightness
- will be clamped between 0 and 1
+alpha
- will be clamped between 0 and 1
+- Returns:
+- a packed Oklab float color that tries to match the requested hue, saturation, and lightness
+
+
+
+-
+
+oklabByHCL
+
+A different way to specify an Oklab color, using hue, chroma, lightness, and alpha something like a normal HSL(A)
+ color but calculating them directly in the Oklab color space. This has you specify the desired chroma directly,
+ as obtainable with chroma(float)
, rather than the saturation, which is a fraction of the maximum chroma
+ (saturation is what oklabByHSL(float, float, float, float)
uses). Note that this takes a different value
+ for its hue
that the method hue(float)
produces, just like lightness
and the method
+ lightness(float)
. The hue is just distributed differently, and the lightness should be equivalent to
+ channelL(float)
. If you use this to get two colors with the same chroma and lightness, but different
+ hue, then the resulting colors should have similar colorfulness unless one or both chroma values exceeded the
+ gamut limit (you can get this limit with chromaLimit(float, float)
). If a chroma value given is greater
+ than the chroma limit, this clamps chroma to that limit. You can use oklabHue(float)
,
+ chroma(float)
, and oklabLightness(float)
to get the hue, chroma, and lightness values from an
+ existing color that this will understand (alpha(float)
too).
+
+- Parameters:
+hue
- between 0 and 1, usually, but this will automatically wrap if too high or too low
+chroma
- will be clamped between 0 and the maximum chroma possible for the given hue and lightness
+lightness
- will be clamped between 0 and 1
+alpha
- will be clamped between 0 and 1
+- Returns:
+- a packed Oklab float color that tries to match the requested hue, chroma, and lightness
+
+
+
+-
limitToGamut
-
+
Checks whether the given Oklab color is in-gamut; if it isn't in-gamut, brings the color just inside
the gamut at the same lightness, or if it is already in-gamut, returns the color as-is.
@@ -1273,7 +1481,7 @@ limitToGamut
-
limitToGamut
-public static float limitToGamut(float L,
+
Checks whether the given Oklab color is in-gamut; if it isn't in-gamut, brings the color just inside
@@ -1294,7 +1502,7 @@ limitToGamut
-
limitToGamut
-public static float limitToGamut(float L,
+
@@ -1314,9 +1522,70 @@ limitToGamut
-
+
+editOklab
+public static float editOklab(float encoded,
+ float addL,
+ float addA,
+ float addB,
+ float addAlpha)
+Given a packed float Oklab color, this edits its L, A, B, and alpha channels by adding the corresponding "add"
+ parameter and then clamping. This returns a different float value (of course, the given float can't be edited
+ in-place). You can give a value of 0 for any "add" parameter you want to stay unchanged. This clamps the
+ resulting color to remain in-gamut, so it should be safe to convert it back to RGBA.
+
+- Parameters:
+encoded
- a packed float Oklab color
+addL
- how much to add to the L channel; typically in the -1 to 1 range
+addA
- how much to add to the A channel; typically in the -1 to 1 range
+addB
- how much to add to the B channel; typically in the -1 to 1 range
+addAlpha
- how much to add to the alpha channel; typically in the -1 to 1 range
+- Returns:
+- a packed float Oklab color with the requested edits applied to
encoded
+
+
+
+-
+
+editOklab
+public static float editOklab(float encoded,
+ float addL,
+ float addA,
+ float addB,
+ float addAlpha,
+ float mulL,
+ float mulA,
+ float mulB,
+ float mulAlpha)
+Given a packed float Oklab color, this edits its L, A, B, and alpha channels by first multiplying each channel by
+ the corresponding "mul" parameter and then adding the corresponding "add" parameter, before clamping. This means
+ the lightness value L
is multiplied by mulL
, then has addL
added, and then is clamped to
+ the normal range for L (0 to 1). This returns a different float value (of course, the given float can't be edited
+ in-place). You can give a value of 0 for any "add" parameter you want to stay unchanged, or a value of 1 for any
+ "mul" parameter that shouldn't change. Note that this manipulates A and B in the -0.5 to 0.5 range, so if you
+ multiply by a small number like 0.25f
, then this will produce a less-saturated color, and if you multiply
+ by a larger number like 4f
, then you will get a much more-saturated color. This clamps the resulting
+ color to remain in-gamut, so it should be safe to convert it back to RGBA.
+
+- Parameters:
+encoded
- a packed float Oklab color
+addL
- how much to add to the L channel; typically in the -1 to 1 range
+addA
- how much to add to the A channel; typically in the -1 to 1 range
+addB
- how much to add to the B channel; typically in the -1 to 1 range
+addAlpha
- how much to add to the alpha channel; typically in the -1 to 1 range
+mulL
- how much to multiply the L channel by; should be non-negative
+mulA
- how much to multiply the A channel by; usually non-negative (not always)
+mulB
- how much to multiply the B channel by; usually non-negative (not always)
+mulAlpha
- how much to multiply the alpha channel by; should be non-negative
+- Returns:
+- a packed float Oklab color with the requested edits applied to
encoded
+
+
+
+-
randomColor
-
+
Produces a random packed float color that is always in-gamut (and opaque) and should be uniformly distributed.
- Parameters:
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/Palette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/Palette.html
index c4e6c0c0..d936ffac 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/Palette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/Palette.html
@@ -3,7 +3,7 @@
-Palette (colorful-pure 0.5.2-SNAPSHOT API)
+Palette (colorful-pure 0.6.0 API)
@@ -70,13 +70,13 @@
Class Palette
-java.lang.Object
+java.lang.Object
com.github.tommyettinger.colorful.pure.oklab.Palette
+extends Object
A palette of predefined colors as packed IPT floats, the kind ColorTools
works with.
You can access colors by their constant name, such as OCEAN_BLUE
, by the NAMED
map using
NAMED.get("Ocean Blue", 0f)
, or by index in the FloatArray called LIST
. Note that to access a float
@@ -837,21 +837,21 @@ Field Summary
This color constant "Mush" has RGBA8888 code B1B10AFF
, L 0.7607843, A 0.47058824, B 0.5764706, alpha 1.0, hue 0.17038202, and saturation 0.62059957.
-static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
+static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, in alphabetical order.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, sorted by lightness from black to white.
@@ -1422,8 +1422,8 @@ Constructor Summary
Method Summary
-Methods inherited from class java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -1438,7 +1438,7 @@ Field Details
-
NAMED
-
+
-
@@ -5802,7 +5802,7 @@
RASPBERRY
-
NAMES
-
+
All names for colors in this palette, in alphabetical order. You can fetch the corresponding packed float color
by looking up a name in NAMED
.
@@ -5810,7 +5810,7 @@ NAMES
-
NAMES_BY_HUE
-
+
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue. You can fetch the corresponding packed float color by looking up a name in NAMED
.
@@ -5818,7 +5818,7 @@ NAMES_BY_HUE
-
NAMES_BY_LIGHTNESS
-
+
All names for colors in this palette, sorted by lightness from black to white. You can fetch the
corresponding packed float color by looking up a name in NAMED
.
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/SimplePalette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/SimplePalette.html
index ad7df79e..e5649dbf 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/SimplePalette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/SimplePalette.html
@@ -3,7 +3,7 @@
-SimplePalette (colorful-pure 0.5.2-SNAPSHOT API)
+SimplePalette (colorful-pure 0.6.0 API)
@@ -74,13 +74,13 @@
Class SimplePalette
-java.lang.Object
+java.lang.Object
com.github.tommyettinger.colorful.pure.oklab.SimplePalette
+extends Object
A palette of predefined colors as packed IPT floats, the kind ColorTools
works with.
You can access colors by their constant name, such as OCEAN_BLUE
, by the NAMED
map using
NAMED.get("Ocean Blue", 0f)
, or by index in the FloatArray called LIST
. Note that to access a float
@@ -103,7 +103,7 @@ Field Summary
Modifier and Type
Field
Description
-static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
+static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
Stores alternative names for colors in NAMED
, like "grey" as an alias for GRAY
or "gold" as an
@@ -254,23 +254,23 @@ Field Summary
This color constant "moss" has RGBA8888 code 204608FF
, L 0.3764706, A 0.45882353, B 0.5372549, alpha 1.0, hue 0.28017563, and saturation 0.23527473.
-static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
+static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
You can look up colors by name here; the names are lower-case, and the colors are packed floats in rgba format.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, in alphabetical order.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, sorted by lightness from black to white.
@@ -417,7 +417,7 @@ Method Summary
Modifier and Type
Method
Description
-static String
+static String
bestMatch(float oklab,
int mixCount)
@@ -425,7 +425,7 @@ Method Summary
using at most mixCount
colors to mix in.
static float
-parseDescription(String description)
+parseDescription(String description)
Parses a color description and returns the approximate color it describes, as a packed float color.
@@ -433,8 +433,8 @@ Method Summary
-Methods inherited from class java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -449,14 +449,14 @@ Field Details
-
NAMED
-
+
You can look up colors by name here; the names are lower-case, and the colors are packed floats in rgba format.
-
ALIASES
-
+
Stores alternative names for colors in NAMED
, like "grey" as an alias for GRAY
or "gold" as an
alias for SAFFRON
. Currently, the list of aliases is as follows:
@@ -1334,7 +1334,7 @@ RASPBERRY
-
NAMES
-
+
All names for colors in this palette, in alphabetical order. You can fetch the corresponding packed float color
by looking up a name in NAMED
.
@@ -1342,7 +1342,7 @@ NAMES
-
NAMES_BY_HUE
-
+
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue. You can fetch the corresponding packed float color by looking up a name in NAMED
.
@@ -1357,7 +1357,7 @@ COLORS_BY_HUE
-
NAMES_BY_LIGHTNESS
-
+
All names for colors in this palette, sorted by lightness from black to white. You can fetch the
corresponding packed float color by looking up a name in NAMED
.
@@ -1387,7 +1387,7 @@ Method Details
-
parseDescription
-
+
Parses a color description and returns the approximate color it describes, as a packed float color.
Color descriptions consist of one or more lower-case words, separated by non-alphabetical characters (typically
spaces and/or hyphens). Any word that is the name of a color in this SimplePalette will be looked up in
@@ -1414,7 +1414,7 @@ parseDescription
-
bestMatch
-public static String bestMatch(float oklab,
+
Given a color as a packed Oklab float, this finds the closest description it can to match the given color while
using at most mixCount
colors to mix in. You should only use small numbers for mixCount, like 1 to 3;
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/ColorTools.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/ColorTools.html
index d7650feb..017f5385 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/ColorTools.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/ColorTools.html
@@ -3,7 +3,7 @@
-Uses of Class com.github.tommyettinger.colorful.pure.oklab.ColorTools (colorful-pure 0.5.2-SNAPSHOT API)
+Uses of Class com.github.tommyettinger.colorful.pure.oklab.ColorTools (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/Palette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/Palette.html
index 87549bfd..7adbae2a 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/Palette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/Palette.html
@@ -3,7 +3,7 @@
-Uses of Class com.github.tommyettinger.colorful.pure.oklab.Palette (colorful-pure 0.5.2-SNAPSHOT API)
+Uses of Class com.github.tommyettinger.colorful.pure.oklab.Palette (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/SimplePalette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/SimplePalette.html
index 44506607..b038ed74 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/SimplePalette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/class-use/SimplePalette.html
@@ -3,7 +3,7 @@
-Uses of Class com.github.tommyettinger.colorful.pure.oklab.SimplePalette (colorful-pure 0.5.2-SNAPSHOT API)
+Uses of Class com.github.tommyettinger.colorful.pure.oklab.SimplePalette (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-summary.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-summary.html
index ff88708d..e00b8a18 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-summary.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-summary.html
@@ -3,7 +3,7 @@
-com.github.tommyettinger.colorful.pure.oklab (colorful-pure 0.5.2-SNAPSHOT API)
+com.github.tommyettinger.colorful.pure.oklab (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-tree.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-tree.html
index da0aafd8..b0aa0f8b 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-tree.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-tree.html
@@ -3,7 +3,7 @@
-com.github.tommyettinger.colorful.pure.oklab Class Hierarchy (colorful-pure 0.5.2-SNAPSHOT API)
+com.github.tommyettinger.colorful.pure.oklab Class Hierarchy (colorful-pure 0.6.0 API)
@@ -60,7 +60,7 @@ Hierarchy For Package com.github.tommyettinger.colorful.pure.o
Class Hierarchy
-- java.lang.Object
+
- java.lang.Object
- com.github.tommyettinger.colorful.pure.oklab.ColorTools
- com.github.tommyettinger.colorful.pure.oklab.Palette
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-use.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-use.html
index 434be90b..955cb529 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-use.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/oklab/package-use.html
@@ -3,7 +3,7 @@
-Uses of Package com.github.tommyettinger.colorful.pure.oklab (colorful-pure 0.5.2-SNAPSHOT API)
+Uses of Package com.github.tommyettinger.colorful.pure.oklab (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-summary.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-summary.html
index f36ada8c..704736d0 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-summary.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-summary.html
@@ -3,7 +3,7 @@
-com.github.tommyettinger.colorful.pure (colorful-pure 0.5.2-SNAPSHOT API)
+com.github.tommyettinger.colorful.pure (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-tree.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-tree.html
index ff1cc585..00ef6d83 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-tree.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-tree.html
@@ -3,7 +3,7 @@
-com.github.tommyettinger.colorful.pure Class Hierarchy (colorful-pure 0.5.2-SNAPSHOT API)
+com.github.tommyettinger.colorful.pure Class Hierarchy (colorful-pure 0.6.0 API)
@@ -60,7 +60,7 @@ Hierarchy For Package com.github.tommyettinger.colorful.pure
Class Hierarchy
-- java.lang.Object
+
- java.lang.Object
- com.github.tommyettinger.colorful.pure.FloatColors
- com.github.tommyettinger.colorful.pure.MathTools
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-use.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-use.html
index 867187b8..7aabc5e0 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-use.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/package-use.html
@@ -3,7 +3,7 @@
-Uses of Package com.github.tommyettinger.colorful.pure (colorful-pure 0.5.2-SNAPSHOT API)
+Uses of Package com.github.tommyettinger.colorful.pure (colorful-pure 0.6.0 API)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/ColorTools.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/ColorTools.html
index afceeecc..9a577b14 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/ColorTools.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/ColorTools.html
@@ -3,7 +3,7 @@
-ColorTools (colorful-pure 0.5.2-SNAPSHOT API)
+ColorTools (colorful-pure 0.6.0 API)
@@ -74,13 +74,13 @@
Class ColorTools
-java.lang.Object
+java.lang.Object
com.github.tommyettinger.colorful.pure.rgb.ColorTools
+extends Object
Contains code for manipulating colors as int
and packed float
values in the RGB color space.
All of these colors have an alpha channel as well as red, green, and blue; the package name isn't
"rgba" because "ycwcm" and "ipt" don't mention alpha either and they also have that channel. RGB is the standard mode
@@ -155,6 +155,30 @@ Method Summary
contrastingColor
's lightness, but the same chromatic channels and opacity.
static float
+editRGB(float encoded,
+ float addR,
+ float addG,
+ float addB,
+ float addAlpha)
+
+Given a packed float RGB color, this edits its red, green, blue, and alpha channels by adding the corresponding
+ "add" parameter and then clamping.
+
+static float
+editRGB(float encoded,
+ float addR,
+ float addG,
+ float addB,
+ float addAlpha,
+ float mulR,
+ float mulG,
+ float mulB,
+ float mulAlpha)
+
+Given a packed float RGB color, this edits its red, green, blue, and alpha channels by first multiplying each
+ channel by the corresponding "mul" parameter and then adding the corresponding "add" parameter, before clamping.
+
+static float
fade(float start,
float change)
@@ -228,7 +252,7 @@ Method Summary
wraps it around if it would go above 1.0, then averages that with the original lightness.
static float
-randomColor(Random random)
+randomColor(Random random)
Produces a random packed float color that is always opaque and should be uniformly distributed.
@@ -292,8 +316,8 @@ Method Summary
-Methods inherited from class java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -753,9 +777,67 @@ lessenChange
-
+
+editRGB
+public static float editRGB(float encoded,
+ float addR,
+ float addG,
+ float addB,
+ float addAlpha)
+Given a packed float RGB color, this edits its red, green, blue, and alpha channels by adding the corresponding
+ "add" parameter and then clamping. Each value is considered in the 0 to 1 range. This returns a different float
+ value (of course, the given float can't be edited in-place). You can give a value of 0 for any "add" parameter
+ you want to stay unchanged.
+
+- Parameters:
+encoded
- a packed float RGB color
+addR
- how much to add to the R channel; typically in the -1 to 1 range
+addG
- how much to add to the G channel; typically in the -1 to 1 range
+addB
- how much to add to the B channel; typically in the -1 to 1 range
+addAlpha
- how much to add to the alpha channel; typically in the -1 to 1 range
+- Returns:
+- a packed float RGB color with the requested edits applied to
encoded
+
+
+
+-
+
+editRGB
+public static float editRGB(float encoded,
+ float addR,
+ float addG,
+ float addB,
+ float addAlpha,
+ float mulR,
+ float mulG,
+ float mulB,
+ float mulAlpha)
+Given a packed float RGB color, this edits its red, green, blue, and alpha channels by first multiplying each
+ channel by the corresponding "mul" parameter and then adding the corresponding "add" parameter, before clamping.
+ This means the red value R
(which is considered in the 0 to 1 range) is multiplied by mulR
, then
+ has addR
added, and then is clamped to the normal range for R (0 to 1). This returns a different float
+ value (of course, the given float can't be edited in-place). You can give a value of 0 for any "add" parameter
+ you want to stay unchanged, or a value of 1 for any "mul" parameter that shouldn't change.
+
+- Parameters:
+encoded
- a packed float RGB color
+addR
- how much to add to the R channel; typically in the -1 to 1 range
+addG
- how much to add to the G channel; typically in the -1 to 1 range
+addB
- how much to add to the B channel; typically in the -1 to 1 range
+addAlpha
- how much to add to the alpha channel; typically in the -1 to 1 range
+mulR
- how much to multiply the R channel by; should be non-negative
+mulG
- how much to multiply the G channel by; should be non-negative
+mulB
- how much to multiply the B channel by; should be non-negative
+mulAlpha
- how much to multiply the alpha channel by; should be non-negative
+- Returns:
+- a packed float RGB color with the requested edits applied to
encoded
+
+
+
+-
randomEdit
-public static float randomEdit(float color,
+
Makes a quasi-randomly-edited variant on the given color
, allowing typically a small amount of
@@ -778,7 +860,7 @@ randomEdit
-
randomColor
-
+
Produces a random packed float color that is always opaque and should be uniformly distributed.
- Parameters:
@@ -791,7 +873,7 @@ randomColor
-
subrandomColor
-public static float subrandomColor(float r,
+
Limited-use; like randomColor(Random)
but for cases where you already have three floats (r, g, and b)
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/Palette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/Palette.html
index 5e2a23cb..6e805798 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/Palette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/Palette.html
@@ -3,7 +3,7 @@
-Palette (colorful-pure 0.5.2-SNAPSHOT API)
+Palette (colorful-pure 0.6.0 API)
@@ -70,13 +70,13 @@
Class Palette
-java.lang.Object
+java.lang.Object
com.github.tommyettinger.colorful.pure.rgb.Palette
+extends Object
A palette of predefined colors as packed RGB(A) floats, the kind ColorTools
works with.
You can access colors by their constant name, such as OCEAN_BLUE
, by the NAMED
map using
NAMED.get("Ocean Blue", 0f)
, or by index in the FloatList called LIST
. Note that to access a float
@@ -837,21 +837,21 @@ Field Summary
This color constant "Mush" has RGBA8888 code B1B10AFF
, hue 0.16666667, saturation 0.654902, lightness 0.36666664, and alpha 1.0.
-static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
+static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, in alphabetical order.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, sorted by lightness from black to white.
@@ -1422,8 +1422,8 @@ Constructor Summary
Method Summary
-Methods inherited from class java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -1438,7 +1438,7 @@ Field Details
-
NAMED
-
+
-
@@ -5802,7 +5802,7 @@
RASPBERRY
-
NAMES
-
+
All names for colors in this palette, in alphabetical order. You can fetch the corresponding packed float color
by looking up a name in NAMED
.
@@ -5810,7 +5810,7 @@ NAMES
-
NAMES_BY_HUE
-
+
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue. You can fetch the corresponding packed float color by looking up a name in NAMED
.
@@ -5818,7 +5818,7 @@ NAMES_BY_HUE
-
NAMES_BY_LIGHTNESS
-
+
All names for colors in this palette, sorted by lightness from black to white. You can fetch the
corresponding packed float color by looking up a name in NAMED
.
diff --git a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/SimplePalette.html b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/SimplePalette.html
index 6bf31aa1..d571503c 100644
--- a/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/SimplePalette.html
+++ b/docs/colorful-pure/apidocs/com/github/tommyettinger/colorful/pure/rgb/SimplePalette.html
@@ -3,7 +3,7 @@
-SimplePalette (colorful-pure 0.5.2-SNAPSHOT API)
+SimplePalette (colorful-pure 0.6.0 API)
@@ -74,13 +74,13 @@
Class SimplePalette
-java.lang.Object
+java.lang.Object
com.github.tommyettinger.colorful.pure.rgb.SimplePalette
-
+
A palette of predefined colors as packed RGB floats, the kind ColorTools
works with, plus a way to describe
colors by combinations and adjustments. The description code is probably what you would use this class for; it
revolves around parseDescription(String)
, which takes a color description String and returns a packed float
@@ -111,7 +111,7 @@ Field Summary
Modifier and Type
Field
Description
-static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
+static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
Stores alternative names for colors in NAMED
, like "grey" as an alias for GRAY
or "gold" as an
@@ -262,23 +262,23 @@ Field Summary
This color constant "moss" has RGBA8888 code 204608FF
, R 0.1254902, G 0.27450982, B 0.03137255, alpha 1.0, hue 0.26881722, and saturation 0.24313727.
-static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
+static com.github.tommyettinger.ds.ObjectFloatOrderedMap<String>
You can look up colors by name here; the names are lower-case, and the colors are packed floats in rgba format.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, in alphabetical order.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, with grayscale first, then sorted by hue from red to yellow to green to
blue.
-static com.github.tommyettinger.ds.ObjectList<String>
+static com.github.tommyettinger.ds.ObjectList<String>
All names for colors in this palette, sorted by lightness from black to white.
@@ -425,7 +425,7 @@ Method Summary
Modifier and Type
Method
Description
-static String
+static String
bestMatch(float rgb,
int mixCount)
@@ -433,7 +433,7 @@ Method Summary
using at most mixCount
colors to mix in.
static float
-parseDescription(String description)
+parseDescription(String description)
Parses a color description and returns the approximate color it describes, as a packed float color.
@@ -441,8 +441,8 @@ Method Summary
-Methods inherited from class java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@@ -457,14 +457,14 @@ Field Details
-
NAMED
-
+
You can look up colors by name here; the names are lower-case, and the colors are packed floats in rgba format.
-
ALIASES
-
+
Stores alternative names for colors in NAMED
, like "grey" as an alias for GRAY
or "gold" as an
alias for SAFFRON
. Currently, the list of aliases is as follows:
@@ -485,14 +485,14 @@ ALIASES
-
LIST
-
+
Lists the packed float color values in this, in no particular order. Does not include duplicates from aliases.
-
TRANSPARENT
-
+
This color constant "transparent" has RGBA8888 code 00000000
, R 0.0, G 0.0, B 0.0, alpha 0.0, hue 0.0, and saturation 0.0.
It can be represented as a packed float with the constant 0x0.0p0F
.
@@ -509,7 +509,7 @@ TRANSPARENT
-
BLACK
-
+
This color constant "black" has RGBA8888 code 000000FF
, R 0.0, G 0.0, B 0.0, alpha 1.0, hue 0.0, and saturation 0.0.
It can be represented as a packed float with the constant -0x1.0p125F
.
@@ -526,7 +526,7 @@ BLACK
-
GRAY
-
+
This color constant "gray" has RGBA8888 code 808080FF
, R 0.5019608, G 0.5019608, B 0.5019608, alpha 1.0, hue 0.0, and saturation 0.0.
It can be represented as a packed float with the constant -0x1.0101p126F
.
@@ -543,7 +543,7 @@ GRAY
-
SILVER
-
+
This color constant "silver" has RGBA8888 code B6B6B6FF
, R 0.7137255, G 0.7137255, B 0.7137255, alpha 1.0, hue 0.0, and saturation 0.0.
It can be represented as a packed float with the constant -0x1.6d6d6cp126F
.
@@ -560,7 +560,7 @@ SILVER
-
WHITE
-
+
This color constant "white" has RGBA8888 code FFFFFFFF
, R 1.0, G 1.0, B 1.0, alpha 1.0, hue 0.0, and saturation 0.0.
It can be represented as a packed float with the constant -0x1.fffffep126F
.
@@ -577,7 +577,7 @@ WHITE
-
RED
-
+
This color constant "red" has RGBA8888 code FF0000FF
, R 1.0, G 0.0, B 0.0, alpha 1.0, hue 0.0, and saturation 1.0.
It can be represented as a packed float with the constant -0x1.0001fep125F
.
@@ -594,7 +594,7 @@ RED
-
ORANGE
-
+
This color constant "orange" has RGBA8888 code FF7F00FF
, R 1.0, G 0.49803922, B 0.0, alpha 1.0, hue 0.08300654, and saturation 1.0.
It can be represented as a packed float with the constant -0x1.00fffep125F
.
@@ -611,7 +611,7 @@ ORANGE
-
YELLOW
-
+
This color constant "yellow" has RGBA8888 code FFFF00FF
, R 1.0, G 1.0, B 0.0, alpha 1.0, hue 0.16666667, and saturation 1.0.
It can be represented as a packed float with the constant -0x1.01fffep125F
.
@@ -628,7 +628,7 @@ YELLOW
-
GREEN
-
+
This color constant "green" has RGBA8888 code 00FF00FF
, R 0.0, G 1.0, B 0.0, alpha 1.0, hue 0.33333334, and saturation 1.0.
It can be represented as a packed float with the constant -0x1.01fep125F
.
@@ -645,7 +645,7 @@ GREEN
-
BLUE
-
+
This color constant "blue" has RGBA8888 code 0000FFFF
, R 0.0, G 0.0, B 1.0, alpha 1.0, hue 0.6666667, and saturation 1.0.
It can be represented as a packed float with the constant -0x1.fep126F
.
@@ -662,7 +662,7 @@ BLUE
-
INDIGO
-
+
This color constant "indigo" has RGBA8888 code 520FE0FF
, R 0.32156864, G 0.05882353, B 0.8784314, alpha 1.0, hue 0.7200957, and saturation 0.81960785.
It can be represented as a packed float with the constant -0x1.c01ea4p126F
.
@@ -679,7 +679,7 @@ INDIGO
-
VIOLET
-
+
This color constant "violet" has RGBA8888 code 9040EFFF
, R 0.5647059, G 0.2509804, B 0.9372549, alpha 1.0, hue 0.74285716, and saturation 0.6862745.
It can be represented as a packed float with the constant -0x1.de812p126F
.
@@ -696,7 +696,7 @@ VIOLET
-
PURPLE
-
+
This color constant "purple" has RGBA8888 code C000FFFF
, R 0.7529412, G 0.0, B 1.0, alpha 1.0, hue 0.7921569, and saturation 1.0.
It can be represented as a packed float with the constant -0x1.fe018p126F
.
@@ -713,7 +713,7 @@ PURPLE
-
BROWN
-
+
This color constant "brown" has RGBA8888 code 8F573BFF
, R 0.56078434, G 0.34117648, B 0.23137255, alpha 1.0, hue 0.055555552, and saturation 0.3294118.
It can be represented as a packed float with the constant -0x1.76af1ep125F
.
@@ -730,7 +730,7 @@ BROWN
-
PINK
-
+
This color constant "pink" has RGBA8888 code FFA0E0FF
, R 1.0, G 0.627451, B 0.8784314, alpha 1.0, hue 0.8877193, and saturation 0.372549.
It can be represented as a packed float with the constant -0x1.c141fep126F
.
@@ -747,7 +747,7 @@ PINK
-
MAGENTA
-public static final float