Skip to main content

try_parse_color

Function try_parse_color 

Source
pub fn try_parse_color(color: &str) -> Result<Hsla>
Expand description

Try to parse the color, HEX or Tailwind Color expression.

ยงParameter color should be one string value listed below:

  • #RRGGBB - The HEX color string.
  • #RRGGBBAA - The HEX color string with alpha.

Or the Tailwind Color format:

  • name - The color name black, white, or any other defined in crate::color.
  • name-scale - The color name with scale.
  • name/opacity - The color name with opacity, opacity should be an integer between 0 and 100.
  • name-scale/opacity - The color name with scale and opacity.