LayerColorAdjustment class (RadialMenu)

LayerColorAdjustment(oLayer)

new LayerColorAdjustment(oLayer)

The LayerColorAdjustment object holds an expression for Red, Green and Blue chanels, to transform the layer's image. The Brightness and Contrast properties of the Layer object are implemented using the LayerColorAdjustment object. The Brightness property applies a color transformation to the layer's image by adjusting the brightness of the red, green and blue chanels, while the Contrast property applies a color transformation to the layer's image by adjusting the contrast of the red, green and blue chanels. For instance, if youse the Red property of the Brightness object to set a formula-expression of "value", the control applies a color transformation to the layer's image by adjusting the brightness of the red chanel based on the Layer.Value property.
Parameters:
Name Type Description
oLayer Layer Specifies the layer to which the color adjustment applies. The layer is indicated as an object of Layer type, and it is used to retrieve the layer's value (Layer.Value property) when evaluating the Red, Green and Blue expressions.

Members

Blue :number|string

The Blue property defines the percent value or the format-expression of the blue-channel adjustment to display the layer, which corresponds to the [contrast.blue] or [brightness.blue] flag used in the layers field. The Red and Green properties define the same for the red and green channels respectively. For instance, if you set the Blue property to "value/2", when the layer's value is 100, it is displayed with 50% of its blue color, and when the layer's value is 0, it is displayed with 0% of its blue color. If you set it to "100 - value/2", it is displayed with more blue color as its value increases. If you set it to a constant number like 30, it is displayed with 30% of its blue color regardless of its value.

The expression supports the following keywords:

"value", indicates the Layer.Value property of the layer, which is the value displayed by the layer and can be linked to the layer's rotation angle or offset though the rotateAngleToValue, offsetToValue fields, so when the layer is rotated or moved, its value changes accordingly.
Type:
  • number | string
Example
50 {number}, the layer is displayed with 50% of its blue color regardless of its value
"value/2" {string}, the layer is displayed with the blue color that is half of its value
"100 - value" {string}, the layer is displayed with more blue color as its value increases
Blue

Green :number|string

The Green property defines the percent value or the format-expression of the green-channel adjustment to display the layer, which corresponds to the [contrast.green] or [brightness.green] flag used in the layers field. The Red and Blue properties define the same for the red and blue channels respectively. For instance, if you set the Green property to "value/2", when the layer's value is 100, it is displayed with 50% of its green color, and when the layer's value is 0, it is displayed with 0% of its green color. If you set it to "100 - value/2", it is displayed with more green color as its value increases. If you set it to a constant number like 30, it is displayed with 30% of its green color regardless of its value.

The expression supports the following keywords:

"value", indicates the Layer.Value property of the layer, which is the value displayed by the layer and can be linked to the layer's rotation angle or offset though the rotateAngleToValue, offsetToValue fields, so when the layer is rotated or moved, its value changes accordingly.
Type:
  • number | string
Example
50 {number}, the layer is displayed with 50% of its green color regardless of its value
"value/2" {string}, the layer is displayed with the green color that is half of its value
"100 - value" {string}, the layer is displayed with more green color as its value increases
Green

Options :LayerColorAdjustmentOptions

The Options property defines the color's options (red, green or blue) at once. This method allows you to update multiple settings of a color in a single call, providing a convenient way to modify the color's appearance and behavior on the control. You can pass an object of LayerColorAdjustmentOptions type with the desired properties to change, and the method will apply those changes to the event accordingly.

Every option of the LayerColorAdjustmentOptions type has associated a property of the LayerColorAdjustment object. For instance, the option:

red {string}, defines the format-expression (that generates a number between 0 and 100) that's applied on the red-chanel
is associated with the property:
Red {string}, defines the format-expression (that generates a number between 0 and 100) that's applied on the red-chanel
which means that the following statements are equivalent:
oColor.Options = {red: "value/2"}
oColor.SetOptions({red: "value/2"})
oColor.Red = "value/2"
oColor.SetBack("value/2")

It is important to note that changing a field of the Options object does not automatically update the color. For example, oColor.Options.red = "red" does not apply the change. Instead, you must assign the Options property again, such as oColor.Options = {red: "red"}, so the control updates and applies the new value.

Type:
Since:
  • 5.4
Example
The following statements are equivalents:

 oColor.Options = {red: "value/2"}
 oColor.SetOptions({red: "value/2"})

where oColor is an object of LayerColorAdjustment type
Options

Red :number|string

The Red property defines the percent value or the format-expression of the red-channel adjustment to display the layer, which corresponds to the [contrast.red] or [brightness.red] flag used in the layers field. The Green and Blue properties define the same for the green and blue channels respectively. For instance, if you set the Red property to "value/2", when the layer's value is 100, it is displayed with 50% of its red color, and when the layer's value is 0, it is displayed with 0% of its red color. If you set it to "100 - value/2", it is displayed with more red color as its value increases. If you set it to a constant number like 30, it is displayed with 30% of its red color regardless of its value.

The expression supports the following keywords:

"value", indicates the Layer.Value property of the layer, which is the value displayed by the layer and can be linked to the layer's rotation angle or offset though the rotateAngleToValue, offsetToValue fields, so when the layer is rotated or moved, its value changes accordingly.
Type:
  • number | string
Example
50 {number}, the layer is displayed with 50% of its red color regardless of its value
"value/2" {string}, the layer is displayed with the red color that is half of its value
"100 - value" {string}, the layer is displayed with more red color as its value increases
Red