-
public class ColorsUtilities to manipulate and convert colors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interfaceColors.LinearColorpublic enumColors.RgbTypeTypes of RGB colors.
public enumColors.RgbaTypeTypes of RGBA colors.
public enumColors.ConversionType of color conversion to use when converting to/from sRGB and linear spaces.
-
Method Summary
Modifier and Type Method Description static Array<float>toLinear(@NonNull() Colors.RgbType type, float r, float g, float b)Converts an RGB color to linear space, the conversion depends on the specified type. static Array<float>toLinear(@NonNull() Colors.RgbType type, @NonNull() @Size(min = 3) Array<float> rgb)Converts an RGB color to linear space, the conversion depends on the specified type. static Array<float>toLinear(@NonNull() Colors.RgbaType type, float r, float g, float b, float a)Converts an RGBA color to linear space, with pre-multiplied alpha. static Array<float>toLinear(@NonNull() Colors.RgbaType type, @NonNull() @Size(min = 4) Array<float> rgba)Converts an RGBA color to linear space, with pre-multiplied alpha. static Array<float>toLinear(@NonNull() Colors.Conversion conversion, @NonNull() @Size(min = 3) Array<float> rgb)Converts an RGB color in sRGB space to an RGB color in linear space. static Array<float>cct(float temperature)Converts a correlated color temperature to a linear RGB color in sRGB space. static Array<float>illuminantD(float temperature)Converts a CIE standard illuminant series D to a linear RGB color in sRGB space. -
-
Method Detail
-
toLinear
@NonNull()@Size(value = 3) static Array<float> toLinear(@NonNull() Colors.RgbType type, float r, float g, float b)
Converts an RGB color to linear space, the conversion depends on the specified type.
- Parameters:
type- the color space of the RGB color values providedr- the red componentg- the green componentb- the blue component
-
toLinear
@NonNull()@Size(min = 3) static Array<float> toLinear(@NonNull() Colors.RgbType type, @NonNull() @Size(min = 3) Array<float> rgb)
Converts an RGB color to linear space, the conversion depends on the specified type.
- Parameters:
type- the color space of the RGB color values providedrgb- an RGB float array of size 3, will be modified
-
toLinear
@NonNull()@Size(value = 4) static Array<float> toLinear(@NonNull() Colors.RgbaType type, float r, float g, float b, float a)
Converts an RGBA color to linear space, with pre-multiplied alpha.
- Parameters:
type- the color space and type of RGBA color values providedr- the red componentg- the green componentb- the blue componenta- the alpha component
-
toLinear
@NonNull()@Size(min = 4) static Array<float> toLinear(@NonNull() Colors.RgbaType type, @NonNull() @Size(min = 4) Array<float> rgba)
Converts an RGBA color to linear space, with pre-multiplied alpha.
- Parameters:
type- the color space of the RGBA color values providedrgba- an RGBA float array of size 4, will be modified
-
toLinear
@NonNull() static Array<float> toLinear(@NonNull() Colors.Conversion conversion, @NonNull() @Size(min = 3) Array<float> rgb)
Converts an RGB color in sRGB space to an RGB color in linear space.
- Parameters:
conversion- the conversion algorithm to usergb- an RGB float array of at least size 3, will be modified
-
cct
@NonNull()@Size(value = 3) static Array<float> cct(float temperature)
Converts a correlated color temperature to a linear RGB color in sRGB space. The temperaturemust be expressed in Kelvin and must be in the range 1,000K to 15,000K.
- Parameters:
temperature- the temperature, in Kelvin
-
illuminantD
@NonNull()@Size(value = 3) static Array<float> illuminantD(float temperature)
Converts a CIE standard illuminant series D to a linear RGB color in sRGB space. Thetemperature must be expressed in Kelvin and must be in the range 4,000K to 25,000K.
- Parameters:
temperature- the temperature, in Kelvin
-
-
-
-