This is the documentation page for Module:Docbunto/testcases/Classmod
Color item class, used for color processing. The class provides color prop getter-setters, procedures for color computation, compositing methods and serialisation into CSS color formats.
Documentation
Package items
Color.tup(table)- Color tuple.
Color.typ(member • string)- Color space type.
Color.alp(member • number)- Color alpha channel value.
Color:new(typ, tup, alp)(function • constructor)- Color instance constructor.
- Parameters:
- Errors:
- Returns: Color instance. (Color)
Color:string()(function)- Color string default output.
- Returns: Hexadecimal 6-digit or HSLA color string. (string)
- Usage:
colors.parse('hsl(214, 15%, 30%)'):string() == '#404a57'colors.parse('#404a5780'):string() == 'hsl(214, 15%, 30%, 0.5)'
Color:hex()(function)- Color hexadecimal string output.
- Returns: Hexadecimal color string. (string)
- Usage:
colors.parse('hsl(214, 15%, 30%)'):hex() == '#404a57' Color:rgb()(function)- RGBA functional color string output.
- Returns: RGBA color string. (string)
- Usage:
colors.parse('hsl(214, 15%, 30%)'):rgb() == 'rgb(64, 74, 87)' - See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()
Color:hsl()(function)- HSL functional color string output.
- Returns: HSLA color string. (string)
- Usage:
colors.parse('rgb(64, 74, 87)'):hsl() == 'hsl(214, 15%, 30%)' - See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()