Struct roccat_vulcan_api_rs::Hue [−][src]
pub struct Hue(_);
Expand description
Color hue. Gauranties that the value is between 0 and 1.
Used by ColorRgb::new_hsv.
Examlpe
use roccat_vulcan_api_rs::Hue; assert_eq!(Hue::new(0.5_f64).unwrap().value(), 0.5_f64); assert_eq!(Hue::new(1.5_f64), None); assert_eq!(Hue::new_from_degree(180_f64), Hue::new(0.5_f64))
Implementations
Create a new value between 0 and 1
Example
use roccat_vulcan_api_rs::Hue; assert_eq!(Hue::new(0.5_f64).unwrap().value(), 0.5_f64); assert_eq!(Hue::new(1.5_f64), None);
Create a hue from an angle in degree
Examlpe
use roccat_vulcan_api_rs::Hue; assert_eq!(Hue::new_from_degree(180_f64), Hue::new(0.5_f64))
Create a new hue from an angle in radiant
Example
use std::f64::consts::PI; use roccat_vulcan_api_rs::Hue; assert_eq!(Hue::new_from_radiant(PI), Hue::new(0.5_f64))
Get the hue in degree
Example
use roccat_vulcan_api_rs::Hue; let hue = Hue::new(0.5_f64).unwrap(); assert_eq!(hue.degree(), 180_f64); let hue = Hue::new(0_f64).unwrap(); assert_eq!(hue.degree(), 0_f64); let hue = Hue::new(0.25_f64).unwrap(); assert_eq!(hue.degree(), 90_f64);
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Hue
impl UnwindSafe for Hue
Blanket Implementations
Mutably borrows from an owned value. Read more