Package 

Class Colors


  • 
    public class Colors
    
                        

    Utilities to manipulate and convert colors.

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 provided
        r - the red component
        g - the green component
        b - 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 provided
        rgb - 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 provided
        r - the red component
        g - the green component
        b - the blue component
        a - 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 provided
        rgba - 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 use
        rgb - 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