From 220228c183d7a2f5dcf161586f004196f306f895 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 1 Nov 2023 21:15:06 -0400 Subject: [PATCH] Fix underflow when indexing into `ColorScale`s --- crates/theme2/src/scale.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/theme2/src/scale.rs b/crates/theme2/src/scale.rs index a22036df8d..c02f078c89 100644 --- a/crates/theme2/src/scale.rs +++ b/crates/theme2/src/scale.rs @@ -132,19 +132,19 @@ impl ColorScaleSet { } pub fn light(&self, step: ColorScaleStep) -> Hsla { - self.light[step - 1] + self.light[step] } pub fn light_alpha(&self, step: ColorScaleStep) -> Hsla { - self.light_alpha[step - 1] + self.light_alpha[step] } pub fn dark(&self, step: ColorScaleStep) -> Hsla { - self.dark[step - 1] + self.dark[step] } pub fn dark_alpha(&self, step: ColorScaleStep) -> Hsla { - self.dark_alpha[step - 1] + self.dark_alpha[step] } pub fn step(&self, cx: &AppContext, step: ColorScaleStep) -> Hsla {