bool IsSdr { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The IsSdr property of the Color struct indicates whether all the color components (red, green, blue, and alpha) are within the standard dynamic range (SDR), which is between 0 and 1. This property is useful for determining if a color can be represented accurately within the typical range used for most color displays and formats.

Usage

Use the IsSdr property to check if a color is within the standard dynamic range. This can be particularly useful when working with color data that needs to be clamped or adjusted to fit within the SDR range for display or processing purposes.

Example

Color color = new Color(0.5f, 0.5f, 0.5f, 1.0f);
bool isSdr = color.IsSdr;

if (isSdr)
{
    // The color is within the standard dynamic range
    // Proceed with operations that require SDR colors
}
else
{
    // The color is outside the standard dynamic range
    // Consider clamping or adjusting the color
}