Colors can be used as arguments for the color property on shapes and icons. Code Shrew supports solid color (i.e., one color) and gradients (i.e., multiple colors blending together).

Solid colors

You can specify solid colors using quoted text. The text should contain color's name or its RGB value. This means that both methods shown below result in a blue circle.

Personally, I like method 1 much better - it is much easier to read and understand. Code Shrew know about 147 different color names, so referring to colors by name doesn't mean you are limited to a small set of boring colors! The full list of available color names is included further down this page. The following code creates a fish colored... salmon:


To create a gradient just use a list of solid colors. For example, to create a circle gradually going from red to blue you can use the following code:

You can use an arbitrary number of colors. For example, the following code creates a rainbow frog:

Available color names