From 3e5f9dfdbb768a980116e4f5e81d3db9feea87ba Mon Sep 17 00:00:00 2001 From: Ygor Souza Date: Wed, 2 Oct 2024 18:52:14 +0200 Subject: [PATCH] Fix off-by-one error In practice it would not have caused problems since the 255 case is handled separately, but we may as well fix it. --- crates/ecolor/src/color32.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ecolor/src/color32.rs b/crates/ecolor/src/color32.rs index aef7a9d1d24..827314c0787 100644 --- a/crates/ecolor/src/color32.rs +++ b/crates/ecolor/src/color32.rs @@ -111,7 +111,7 @@ impl Color32 { static LOOKUP_TABLE: OnceLock> = OnceLock::new(); let lut = LOOKUP_TABLE.get_or_init(|| { use crate::{gamma_u8_from_linear_f32, linear_f32_from_gamma_u8}; - (0..u16::MAX) + (0..=u16::MAX) .map(|i| { let [value, alpha] = i.to_ne_bytes(); let value_lin = linear_f32_from_gamma_u8(value);