Change summary
crates/theme/src/scale.rs | 40 ++++++++++++++++++++++++++++------------
1 file changed, 28 insertions(+), 12 deletions(-)
Detailed changes
@@ -9,18 +9,34 @@ use crate::{ActiveTheme, Appearance};
pub struct ColorScaleStep(usize);
impl ColorScaleStep {
- const ONE: Self = Self(1);
- const TWO: Self = Self(2);
- const THREE: Self = Self(3);
- const FOUR: Self = Self(4);
- const FIVE: Self = Self(5);
- const SIX: Self = Self(6);
- const SEVEN: Self = Self(7);
- const EIGHT: Self = Self(8);
- const NINE: Self = Self(9);
- const TEN: Self = Self(10);
- const ELEVEN: Self = Self(11);
- const TWELVE: Self = Self(12);
+ pub const ONE: Self = Self(1);
+ pub const TWO: Self = Self(2);
+ pub const THREE: Self = Self(3);
+ pub const FOUR: Self = Self(4);
+ pub const FIVE: Self = Self(5);
+ pub const SIX: Self = Self(6);
+ pub const SEVEN: Self = Self(7);
+ pub const EIGHT: Self = Self(8);
+ pub const NINE: Self = Self(9);
+ pub const TEN: Self = Self(10);
+ pub const ELEVEN: Self = Self(11);
+ pub const TWELVE: Self = Self(12);
+
+ /// All of the steps in a [`ColorScale`].
+ pub const ALL: [ColorScaleStep; 12] = [
+ Self::ONE,
+ Self::TWO,
+ Self::THREE,
+ Self::FOUR,
+ Self::FIVE,
+ Self::SIX,
+ Self::SEVEN,
+ Self::EIGHT,
+ Self::NINE,
+ Self::TEN,
+ Self::ELEVEN,
+ Self::TWELVE,
+ ];
}
/// A scale of colors for a given [ColorScaleSet].