Algosim documentation: color

color

Converts an object to a colour.

Syntax

Description

If X is any object, color(X) tries to convert it to a colour.

Examples

color(16#FF0000)
rgba(1.000, 0.000, 0.000, 1.000) (#FF0000, red)
color("gold")
rgba(1.000, 0.843, 0.000, 1.000) (#FFD700, gold)
color("cornflowerblue")
rgba(0.392, 0.584, 0.929, 1.000) (#6495ED, cornflowerblue)
color("#B8860B")
rgba(0.722, 0.525, 0.043, 1.000) (#B8860B, darkgoldenrod)
GetHSV(color("coral"))
hue: 16.1142857143
saturation: 0.686274509804
value: 1
color(ans)
rgba(1.000, 0.498, 0.314, 1.000) (#FF7F50, coral)

See also