(rgb: [f32; 3])
| 46 | pub(crate) fn srgb_channel_to_linear(c: f32) -> f32 { |
| 47 | if !c.is_finite() || c <= 0.0 { |
| 48 | 0.0 |
| 49 | } else if c <= 0.04045 { |
| 50 | c / 12.92 |
| 51 | } else if c <= 1.0 { |
| 52 | ((c + 0.055) / 1.055).powf(2.4) |
| 53 | } else { |
| 54 | c |
| 55 | } |
| 56 | } |
| 57 |
no test coverage detected