[−][src]Struct geopattern::color::Color
Color is a single color object
Methods
impl Color
[src]
pub fn new(r: f64, g: f64, b: f64) -> Color
[src]
create new colors
pub fn new_hcl(h: f64, c: f64, l: f64) -> Color
[src]
create new colors from hcl color space
pub fn hex(s: &str) -> Result<Color, ColorError>
[src]
convert a hex string ("#abc", "#fedcba") into a Color
object
pub fn rgb(&self) -> (f64, f64, f64)
[src]
get r, g, b for this object
pub fn almost_equal(&self, other: &Self) -> bool
[src]
check if two colors are almost same
this means that the total difference is less than 3 * DELTA
pub fn linear_rgb(&self) -> (f64, f64, f64)
[src]
linear RGB representation for the color
pub fn xyz(&self) -> (f64, f64, f64)
[src]
XYZ representation for the color
http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/ https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L420
pub fn lab(&self) -> (f64, f64, f64)
[src]
LAB representation for the color
http://en.wikipedia.org/wiki/Lab_color_space#CIELAB-CIEXYZ_conversions https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L501
pub fn hcl(&self) -> (f64, f64, f64)
[src]
HCL space values
http://www.hunterlab.com/appnotes/an09_96a.pdf https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L745
pub fn hcl_to_lab(h: f64, c: f64, l: f64) -> (f64, f64, f64)
[src]
https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L773
pub fn lab_to_xyz(l: f64, a: f64, b: f64) -> (f64, f64, f64)
[src]
https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L528
pub fn xyz_to_linear_rgb(x: f64, y: f64, z: f64) -> (f64, f64, f64)
[src]
https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L402
pub fn xyz_to_rgb(x: f64, y: f64, z: f64) -> (f64, f64, f64)
[src]
https://github.com/lucasb-eyer/go-colorful/blob/master/colors.go#L402
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,