[][src]Crate css_colors

Structs

Angle

A struct that represents the number of degrees in a circle. Legal values range from 0-359. Anything else is unused.

HSL

A struct to represent how much hue, saturation, and luminosity should be added to create a color. The hue is a degree on the color wheel; 0 (or 360) is red, 120 is green, 240 is blue. A valid value for h must range between 0-360. The saturation ranges between 0-100, where 0 is completely desaturated, and 100 is full saturation. The luminosity ranges between 0-100, where 0 is no light (black), and 100 is full light (white).

HSLA

A struct to represent how much hue, saturation, and luminosity should be added to create a color. Also handles alpha specifications.

RGB

A struct to represent how much red, green, and blue should be added to create a color.

RGBA

A struct to represent how much red, green, and blue should be added to create a color. Also handles alpha specifications.

Ratio

A struct that represents a ratio and determines the legal value(s) for a given type. Clamps any values that fall beyond the valid legal range for the type. Used to convert a type into a valid percentage representation.

Traits

Color

A trait that can be used for converting between different color models and performing various transformations on them.

Functions

deg

Construct an angle from degrees. Angles outside of the 0-359° range will be normalized accordingly.

hsl

Constructs a HSL Color from numerical values, similar to the hsl function in CSS.

hsla

Constructs a HSLA Color from numerical values, similar to the hsla function in CSS.

percent

Construct an ratio from percentages. Values outside of the 0-100% range will cause a panic.

rgb

Constructs a RGB Color from numerical values, similar to the rgb function in CSS.

rgba

Constructs a RGB Color from numerical values, similar to the rgba function in CSS.