Skip to content

Commit

Permalink
Merge pull request #393 from Ogeon/rename_analogous2
Browse files Browse the repository at this point in the history
Rename `analogous2` to `analogous_secondary`
  • Loading branch information
Ogeon authored Apr 27, 2024
2 parents aa19895 + 8074a98 commit 68410a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions palette/src/color_theory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub trait Analogous: Sized {
/// ```
fn analogous(self) -> (Self, Self);

/// Return the two furthest colors of a 5 color analogous color scheme.
/// Return the next two analogous colors, after the colors `analogous` returns.
///
/// The colors are ordered by ascending hue difference, or `(hue-60°,
/// hue+60°)`. Combined with the input color and the colors from
Expand All @@ -157,7 +157,7 @@ pub trait Analogous: Sized {
///
/// let primary = Hsl::new_srgb(120.0f32, 0.8, 0.5);
/// let (analog_down1, analog_up1) = primary.analogous();
/// let (analog_down2, analog_up2) = primary.analogous2();
/// let (analog_down2, analog_up2) = primary.analogous_secondary();
///
/// let hues = (
/// analog_down2.hue.into_positive_degrees(),
Expand All @@ -169,7 +169,7 @@ pub trait Analogous: Sized {
///
/// assert_eq!(hues, (60.0, 90.0, 120.0, 150.0, 180.0));
/// ```
fn analogous2(self) -> (Self, Self);
fn analogous_secondary(self) -> (Self, Self);
}

impl<T> Analogous for T
Expand All @@ -184,7 +184,7 @@ where
(first, second)
}

fn analogous2(self) -> (Self, Self) {
fn analogous_secondary(self) -> (Self, Self) {
let first = self.clone().shift_hue(T::Scalar::from_f64(300.0));
let second = self.shift_hue(T::Scalar::from_f64(60.0));

Expand Down

0 comments on commit 68410a6

Please sign in to comment.