Struct Alpha
Stores a computational color together with straight alpha.
struct Alpha(Color)
if (isSupportedAlphaColor!Color);
Use straight alpha when color coordinates and opacity should remain independent. Construction stores supplied values unchanged: alpha is not clamped and the color is not converted, clipped, or gamut-mapped.
Color must be one of the supported computational color value types. The
natural state is detectably invalid because its floating components
and alpha are NaN.
Fields
| Name | Type | Description |
|---|---|---|
alpha
|
Alpha | Raw straight alpha value. |
color
|
Color | Wrapped straight color value. |
Properties
| Name | Type | Description |
|---|---|---|
isValidAlpha[get]
|
bool | Reports whether alpha is a usable opacity from 0 through 1. |
Aliases
| Name | Description |
|---|---|
Scalar
|
Scalar component type shared with the wrapped color. |
Example
const value = Alpha!SRgbf(
SRgbf(0.2f, 0.4f, 0.8f),
0.5f
);
assert(value .color == SRgbf(0.2f, 0.4f, 0.8f));
assert(value .alpha == 0.5f);
assert(value .isValidAlpha);