ColorConvert¶
Namespace Nfty.Core.Imaging in assembly Nfty.Ticket.
Conversions between RGB and the two color spaces a layer can be authored in. Hue is in degrees and wraps at 360; saturation, value and lightness are 0..1 fractions.
Methods¶
HslToRgb(double, double, double)¶
Converts a hue/saturation/lightness color to RGB.
Parameters
h(double) - Hue in degrees; wrapped, so 360 is 0.s(double) - Saturation, 0..1.l(double) - Lightness, 0..1.
Returns. The color.
HsvToRgb(double, double, double)¶
Converts a hue/saturation/value color to RGB.
Parameters
h(double) - Hue in degrees; wrapped, so 360 is 0.s(double) - Saturation, 0..1.v(double) - Value, 0..1.
Returns. The color.
RgbToHsl(RgbColor)¶
Converts an RGB color to hue/saturation/lightness.
Parameters
c(RgbColor) - The color.
Returns. Hue in degrees, saturation and lightness as 0..1.
RgbToHsv(RgbColor)¶
Converts an RGB color to hue/saturation/value.
Parameters
c(RgbColor) - The color.
Returns. Hue in degrees, saturation and value as 0..1.