Class and Namespace LrColor

This class encapsulates color values, specified using RGB or grayscale values, or by name.

Use the imported namespace as a constructor; access the functions through the created objects.

Summary

LrColor( ... )
Creates an LrColor object.
Retrieves the alpha (transparency) value of this color.
Retrieves the blue value of this color.
Retrieves the green value of this color.
Retrieves the red value of this color.
Reports the type of this object.

Functions

LrColor( ... )
Creates an LrColor object. Set the color values using a number in the range [0..1]. For red, green, and blue, 1 is saturation. For alpha (transparency), 0 is fully transparent and 1 is fully opaque. For a grayscale value, 0 is white and 1 is black. You can also specify a color by name.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. ...
This function can be called with a variety of parameters.
  • LrColor(): Creates a nil color with red, green, blue, and alpha set to 0.
  • LrColor( r, g, b, a ): Creates an RGB color with red, green, blue and alpha values.
  • LrColor( r, g, b ): Creates an RGB color with red, green, and blue values. Alpha is set to 1.0
  • LrColor( l, a ): Creates a color with the given grayscale and alpha values.
  • LrColor( l ): Creates a color with the given grayscale value and 1.0 as the alpha.
  • LrColor( name ): Creates a color with the given name. Values can be "black", "white", "gray", "light gray", "dark gray", "red", "green", "blue", "cyan", "yellow", "magenta", "orange", "purple", "brown"
  • LrColor( name, a ): Creates a color with the given name and alpha value.

Return value

An LrColor object
color:alpha()
Retrieves the alpha (transparency) value of this color.

First supported in version 1.3 of the Lightroom SDK.

Return value

(number) The alpha value in the range [0.0..1.0]
color:blue()
Retrieves the blue value of this color.

First supported in version 1.3 of the Lightroom SDK.

Return value

(number) The blue value in the range [0.0..1.0]
color:green()
Retrieves the green value of this color.

First supported in version 1.3 of the Lightroom SDK.

Return value

(number) The green value in the range [0.0..1.0]
color:red()
Retrieves the red value of this color.

First supported in version 1.3 of the Lightroom SDK.

Return value

(number) The red value in the range [0.0..1.0]
color:type()
Reports the type of this object.

First supported in version 4.1 of the Lightroom SDK.

Return value

(string) 'LrColor'.