Description
The Luminance
field is a member of the MaskMode
enumeration within the Sandbox.UI
namespace. It specifies that the luminance values of the mask layer image should be used as the mask values. This is useful when you want to create a mask based on the brightness of the image, rather than its transparency or other attributes.
Usage
Use the Luminance
field when you need to apply a mask to a UI element based on the brightness of the mask image. This can be particularly useful in scenarios where the visual effect is dependent on the lightness or darkness of the image.
Example
// Example of using MaskMode.Luminance in a UI component
public class MyCustomUIComponent : Panel
{
public MyCustomUIComponent()
{
// Set the mask mode to use luminance values
this.Style.MaskMode = MaskMode.Luminance;
// Set a mask image
this.Style.MaskImage = "path/to/mask/image.png";
}
}