fix: panic in color.to_string

This commit is contained in:
CJ van den Berg 2025-07-03 16:26:28 +02:00
parent e9735d9425
commit c37f6d0b8d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -49,7 +49,8 @@ pub const RGB = struct {
pub fn to_string(v: RGB, s: *[7]u8) []u8 {
const nib = struct {
fn f(n: u8) u8 {
fn f(n_: u8) u8 {
const n = n_ & 0b1111;
return switch (n & 0b1111) {
0...9 => '0' + n,
0xA...0xF => 'A' + n,