MCPcopy Create free account
hub / github.com/csskit/csskit / from

Method from

crates/chromashift/src/hsl.rs:105–111  ·  view source on GitHub ↗
(value: Srgb)

Source from the content-addressed store, hash-verified

103
104impl From<Srgb> for Hsl {
105 fn from(value: Srgb) -> Self {
106 let r = value.red as f64 / 255.0;
107 let g = value.green as f64 / 255.0;
108 let b = value.blue as f64 / 255.0;
109 let (hue, saturation, lightness) = srgb_float_to_hsl(r, g, b);
110 Hsl::new(hue as f32, saturation as f32, lightness as f32, value.alpha)
111 }
112}
113
114impl From<Hsl> for Srgb {

Callers

nothing calls this directly

Calls 5

srgb_float_to_hslFunction · 0.85
hsl_to_srgb_floatFunction · 0.85
roundMethod · 0.80
gammaFunction · 0.70
linearFunction · 0.70

Tested by

no test coverage detected