[−][src]Function azul_css_parser::parse_direction
pub fn parse_direction<'a>(
input: &'a str
) -> Result<Direction, CssDirectionParseError<'a>>
Parses an direction
such as "50deg"
or "to right bottom"
(in the context of gradients)
Example
use azul_css::DirectionCorner::*; assert_eq!(parse_direction("to right bottom"), Ok(Direction::FromTo(TopLeft, BottomRight))); assert_eq!(parse_direction("to right"), Ok(Direction::FromTo(Left, Right))); assert_eq!(parse_direction("50deg"), Ok(Direction::Angle(FloatValue::new(50.0))));