CieLuv Struct
A color in the CIE 1976 L*u*v* color space (CIELUV), relative to a white, CieXyz.D50 by default.
public readonly struct CieLuv : IEquatable<CieLuv>Remarks
The equations are those of CIE 15:2004 with the exact constants (6/29)^3 and (29/3)^3: the lightness is that of CIELAB, and u* and v* are the distances of the chromaticity (u', v') of the color from the one of the white. Black has no chromaticity: its u* and v* are 0.
The values are not validated: colors outside the gamut of every display and values that are not numbers are kept as they are.
- Implements
Constructors
| Name | Description |
|---|---|
| CieLuv(double, double, double) | Initializes a new instance of the CieLuv struct. |
CieLuv(double, double, double)
CieLuv.csProperties
| Name | Description |
|---|---|
| L | Gets the lightness, from 0 (black) to 100 (the white). |
| U | Gets the u* axis, green (negative) to red (positive). |
| V | Gets the v* axis, blue (negative) to yellow (positive). |
Methods
| Name | Description |
|---|---|
| Equals(CieLuv) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromRgb(Rgba32, RgbColorSpace?) | Converts an 8-bit RGB color to CieLuv. Alpha is ignored. |
| FromRgb(Rgba64, RgbColorSpace?) | Converts a 16-bit RGB color to CieLuv. Alpha is ignored. |
| FromXyz(CieXyz) | Converts a color from CIEXYZ relative to CieXyz.D50. |
| FromXyz(CieXyz, CieXyz) | Converts a color from CIEXYZ relative to a white. |
| GetHashCode() | Returns the hash code for this instance. |
| ToRgba32(RgbColorSpace?) | Converts this color to an opaque 8-bit RGB color, clipped to the gamut of the space component by component. |
| ToRgba64(RgbColorSpace?) | Converts this color to an opaque 16-bit RGB color, clipped to the gamut of the space component by component. |
| ToString() | Returns the fully qualified type name of this instance. |
| ToXyz() | Converts this color to CIEXYZ relative to CieXyz.D50. |
| ToXyz(CieXyz) | Converts this color to CIEXYZ relative to a white. |
FromRgb overloads
FromRgb(Rgba32, RgbColorSpace?)
CieLuv.csConverts an 8-bit RGB color to CieLuv. Alpha is ignored.
public static CieLuv FromRgb(Rgba32 color, RgbColorSpace? colorSpace = null)Parameters
colorRgba32- The color.
colorSpaceRgbColorSpace?- The meaning of the red, green and blue values, or
nullforRgbColorSpace.Srgb.
Returns
CieLuv The color.
FromRgb(Rgba64, RgbColorSpace?)
CieLuv.csConverts a 16-bit RGB color to CieLuv. Alpha is ignored.
public static CieLuv FromRgb(Rgba64 color, RgbColorSpace? colorSpace = null)Parameters
colorRgba64- The color.
colorSpaceRgbColorSpace?- The meaning of the red, green and blue values, or
nullforRgbColorSpace.Srgb.
Returns
CieLuv The color.
FromXyz overloads
FromXyz(CieXyz)
CieLuv.csConverts a color from CIEXYZ relative to CieXyz.D50.
FromXyz(CieXyz, CieXyz)
CieLuv.csGetHashCode()
CieLuv.csToRgba32(RgbColorSpace?)
CieLuv.csConverts this color to an opaque 8-bit RGB color, clipped to the gamut of the space component by component.
public Rgba32 ToRgba32(RgbColorSpace? colorSpace = null)Parameters
colorSpaceRgbColorSpace?- The meaning of the red, green and blue values, or
nullforRgbColorSpace.Srgb.
Returns
Rgba32 The color.
Exceptions
UnsupportedImageFeatureException- The space cannot convert colors to RGB values (
RgbColorSpace.CanConvertFromXyz).
ToRgba64(RgbColorSpace?)
CieLuv.csConverts this color to an opaque 16-bit RGB color, clipped to the gamut of the space component by component.
public Rgba64 ToRgba64(RgbColorSpace? colorSpace = null)Parameters
colorSpaceRgbColorSpace?- The meaning of the red, green and blue values, or
nullforRgbColorSpace.Srgb.
Returns
Rgba64 The color.
Exceptions
UnsupportedImageFeatureException- The space cannot convert colors to RGB values (
RgbColorSpace.CanConvertFromXyz).
ToString()
CieLuv.csOperators
| Name | Description |
|---|---|
| operator ==(CieLuv, CieLuv) | Compares two colors for equality, component by component. |
| operator !=(CieLuv, CieLuv) | Compares two colors for inequality, component by component. |