MaskMode Luminance

book_4_sparkGenerated
code_blocksInput

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 levels 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
var myComponent = new UIComponent();
myComponent.MaskMode = MaskMode.Luminance;

// Assuming myComponent has a method to set a mask image
myComponent.SetMaskImage("path/to/mask/image.png");

// The component will now use the luminance values of the mask image to determine the mask effect.