From b7e488507d23cbc91ac63d5249088ad0f4852205 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 15 Oct 2024 03:08:52 -0700 Subject: [PATCH] fix(color): fix doc test for from_hsl (#1421) --- src/style/color.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/style/color.rs b/src/style/color.rs index ea567677..b1e42dad 100644 --- a/src/style/color.rs +++ b/src/style/color.rs @@ -383,11 +383,13 @@ impl Color { /// ``` /// use ratatui::{palette::Hsl, style::Color}; /// - /// let color: Color = Color::from_hsl(Hsl::new(360.0, 100.0, 100.0)); - /// assert_eq!(color, Color::Rgb(255, 255, 255)); - /// + /// // Black /// let color: Color = Color::from_hsl(Hsl::new(0.0, 0.0, 0.0)); /// assert_eq!(color, Color::Rgb(0, 0, 0)); + /// + /// // White - note: 100% saturation is not converted to white + /// let color: Color = Color::from_hsl(Hsl::new(0.0, 0.0, 100.0)); + /// assert_eq!(color, Color::Rgb(255, 255, 255)); /// ``` #[cfg(feature = "palette")] pub fn from_hsl(hsl: palette::Hsl) -> Self {