Function broot::skin::colors::parse

source ·
pub fn parse(s: &str) -> Result<Option<Color>, InvalidSkinError>
Expand description

read a color from a string. It may be either

  • “none”
  • one of the few known color name. Example: “darkred”
  • grayscale with level in [0,24[. Example: “grey(5)”
  • an Ansi code. Example “ansi(106)”
  • RGB. Example: “rgb(25, 100, 0)” This function needs a lowercase string (assuming lowercasing has be done before, to ensure case-insensitive parsing)