rio
rio copied to clipboard
rio set color value without color conversion
The color gamut of my MacBook's display is Display P3. I tried to set the background color of rio to match Xcode with the value of #1F1F24, but I found through the Display Color Meter that rio directly set the Display P3 value without color space conversion.
Xcode background color
Rio background color
Hey @tsssni thanks for the issue!
hmm, very interesting. Rio follow this conversion: https://github.com/raphamorim/rio/blob/main/rio-backend/src/config/colors/mod.rs#L425-L473
fn decode_hex(s: &str) -> Result<Vec<u8>, ParseIntError> {
(0..s.len())
.step_by(2)
.map(|i| u8::from_str_radix(&s[i..i + 2], 16))
.collect()
}
Hex #FFFFFF
sRGB 0-255 = 255.000 255.000 255.000
sRGB 0-1.0 = 1.00000 1.00000 1.00000
RGB Adobe 98 = 255.000 255.000 255.000