Struct random_color::RandomColor [−][src]
pub struct RandomColor { pub hue: Option<ColorInformation>, pub luminosity: Option<Luminosity>, pub seed: Option<i64>, pub alpha: Option<f32>, }
Fields
hue: Option<ColorInformation>
Can take values of Color
enum.
luminosity: Option<Luminosity>
Can take values of Luminosity
enum.
seed: Option<i64>
Can take any value of i64
.
alpha: Option<f32>
Can take values f32
from 0 to 1.
Methods
impl RandomColor
[src]
impl RandomColor
pub fn new() -> RandomColor
[src]
pub fn new() -> RandomColor
Generates a new RandomColor
pub fn hue(&mut self, hue: Color) -> &mut RandomColor
[src]
pub fn hue(&mut self, hue: Color) -> &mut RandomColor
Sets RandomColor.hue
colorspace.
pub fn luminosity(&mut self, luminosity: Luminosity) -> &mut RandomColor
[src]
pub fn luminosity(&mut self, luminosity: Luminosity) -> &mut RandomColor
Sets RandomColor.luminosity
.
pub fn seed(&mut self, seed: i64) -> &mut RandomColor
[src]
pub fn seed(&mut self, seed: i64) -> &mut RandomColor
Sets RandomColor.seed
used to generate a color.
pub fn alpha(&mut self, alpha: f32) -> &mut RandomColor
[src]
pub fn alpha(&mut self, alpha: f32) -> &mut RandomColor
Sets RandomColor.aplha
to the value passed if it's lower than 1.0.
pub fn random_alpha(&mut self) -> &mut RandomColor
[src]
pub fn random_alpha(&mut self) -> &mut RandomColor
Sets RandomColor.alpha
to None, aka random.
pub fn to_hsv_array(&self) -> [u32; 3]
[src]
pub fn to_hsv_array(&self) -> [u32; 3]
pub fn to_rgb_string(&self) -> String
[src]
pub fn to_rgb_string(&self) -> String
pub fn to_rgba_string(&self) -> String
[src]
pub fn to_rgba_string(&self) -> String
pub fn to_rgb_array(&self) -> [u32; 3]
[src]
pub fn to_rgb_array(&self) -> [u32; 3]
pub fn to_hsl_string(&self) -> String
[src]
pub fn to_hsl_string(&self) -> String
pub fn to_hsla_string(&self) -> String
[src]
pub fn to_hsla_string(&self) -> String
pub fn to_hsl_array(&self) -> [u32; 3]
[src]
pub fn to_hsl_array(&self) -> [u32; 3]
pub fn to_hex(&self) -> String
[src]
pub fn to_hex(&self) -> String
Trait Implementations
impl Debug for RandomColor
[src]
impl Debug for RandomColor
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for RandomColor
[src]
impl PartialEq for RandomColor
fn eq(&self, other: &RandomColor) -> bool
[src]
fn eq(&self, other: &RandomColor) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &RandomColor) -> bool
[src]
fn ne(&self, other: &RandomColor) -> bool
This method tests for !=
.
Auto Trait Implementations
impl Send for RandomColor
impl Send for RandomColor
impl Sync for RandomColor
impl Sync for RandomColor