Documentation
See Color Art.
Usage
Add Dependency
[]
= "0.3"
Color generator
Create color from string
You can use the from_str method to construct a color from a string.
use Color;
use FromStr;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
let color = from_str.unwrap;
Create color from number
You can use the from_num method to construct a color from a number.
For example:
use Color;
let color = from_num.unwrap;
let color = from_num.unwrap;
Create color from name
You can use the from_name method to construct a color from a name.
For example:
use Color;
let color = from_name.unwrap;
Create color from color space
You can use the from_<color_space> method to construct a color from a color space.
Currently supported color spaces:
rgbrgbahslhsvcmykhex
More color spaces will be supported in the future.
For example:
use Color;
let color = from_rgb.unwrap;
let color = from_rgba.unwrap;
let color = from_hsl.unwrap;
let color = from_hsv.unwrap;
let color = from_cmyk.unwrap;
let color = from_hex.unwrap;
More examples can be found in Construct from color spaces.
Other color generator methods
- random - Generate a random color.
- mix - Mix two colors.
- blend - Blend two colors with a blending mode.
- average - Average a list of colors.
Color conversion
Stringify a color
Stringify a color to a string.
Refer to Construct from string.
Color Channels
Extract the color channels.
Refer to Color Channels.
Color Operations
Color operation functions.
Refer to Color Operations.
Made with ❤️ by JiatLn.