mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-27 13:01:13 +00:00
fix(color): fix doc test for from_hsl (#1421)
This commit is contained in:
parent
4728f0e68b
commit
b7e488507d
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user