refactor(terminal): use color module helper u24_to_u8s

This commit is contained in:
CJ van den Berg 2026-04-08 11:31:58 +02:00
parent 2bc8e0ac18
commit d05741ba24
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 8 additions and 9 deletions

View file

@ -106,6 +106,10 @@ pub const RGBf = struct {
const GAMMA = 2.4;
};
pub fn u24_to_u8s(v: u24) [3]u8 {
return .{ @truncate(v >> 16), @truncate(v >> 8), @truncate(v) };
}
pub fn max_contrast(v: u24, a: u24, b: u24) u24 {
return RGB.max_contrast(RGB.from_u24(v), RGB.from_u24(a), RGB.from_u24(b)).to_u24();
}