NAME
std/colour - Colour parsing helpers.
SYNOPSIS
from std/colour import parse_colour;
say( parse_colour("red") ); # #ff0000
say( parse_colour("#abc") ); # #aabbcc
IMPLEMENTATION SUPPORT
This module is supported by all implementations of ZuzuScript.
DESCRIPTION
parse_colour accepts three- and six-digit hexadecimal colours and the CSS3 extended colour keywords. It returns a lowercase six-digit hexadecimal colour string.
EXPORTS
Functions
parse_colour(String x)Parameters:
xis a CSS colour keyword or a three- or six-digit hexadecimal colour string. Returns:String. Returns the normalized lowercase#rrggbbcolour string, or throws ifxis not recognised.
COPYRIGHT AND LICENCE
std/colour is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.