diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs index b29fce72ac..1579519274 100644 --- a/crates/bevy_color/src/hsla.rs +++ b/crates/bevy_color/src/hsla.rs @@ -92,7 +92,7 @@ impl Hsla { /// // Palette with 5 distinct hues /// let palette = (0..5).map(Hsla::sequential_dispersed).collect::>(); /// ``` - pub fn sequential_dispersed(index: u32) -> Self { + pub const fn sequential_dispersed(index: u32) -> Self { const FRAC_U32MAX_GOLDEN_RATIO: u32 = 2654435769; // (u32::MAX / Φ) rounded up const RATIO_360: f32 = 360.0 / u32::MAX as f32; diff --git a/crates/bevy_color/src/lcha.rs b/crates/bevy_color/src/lcha.rs index e5f5ecab32..2a3b115bb3 100644 --- a/crates/bevy_color/src/lcha.rs +++ b/crates/bevy_color/src/lcha.rs @@ -96,7 +96,7 @@ impl Lcha { /// // Palette with 5 distinct hues /// let palette = (0..5).map(Lcha::sequential_dispersed).collect::>(); /// ``` - pub fn sequential_dispersed(index: u32) -> Self { + pub const fn sequential_dispersed(index: u32) -> Self { const FRAC_U32MAX_GOLDEN_RATIO: u32 = 2654435769; // (u32::MAX / Φ) rounded up const RATIO_360: f32 = 360.0 / u32::MAX as f32; diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs index 91ffe422c7..ba52a519ae 100644 --- a/crates/bevy_color/src/oklcha.rs +++ b/crates/bevy_color/src/oklcha.rs @@ -92,7 +92,7 @@ impl Oklcha { /// // Palette with 5 distinct hues /// let palette = (0..5).map(Oklcha::sequential_dispersed).collect::>(); /// ``` - pub fn sequential_dispersed(index: u32) -> Self { + pub const fn sequential_dispersed(index: u32) -> Self { const FRAC_U32MAX_GOLDEN_RATIO: u32 = 2654435769; // (u32::MAX / Φ) rounded up const RATIO_360: f32 = 360.0 / u32::MAX as f32;