Skip to main content

palette

Discworld player help

palette

Name

palette - display a palette of colours.

Syntax


palette [<luminance>]
palette [from] <from colour> [to] <to colour> [luminance] [<luminance level>]
palette inverse [from] <from colour> [to] <to colour> [luminance] [<luminance level>]
palette gradient [from] <start colour> [to] <end colour> [in] <positive number> [steps]
palette inverse gradient [from] <start colour> [to] <end colour> [in] <positive number> [steps]
palette text gradient [from] <start colour> [to] <end colour> <sample text>
palette inverse text gradient [from] <start colour> [to] <end colour> <sample text>
palette text-and-spaces gradient [from] <start colour> [to] <end colour> <sample text>
palette inverse text-and-spaces gradient [from] <start colour> [to] <end colour> <sample text>
palette vertical gradient [from] <start colour> [to] <end colour> [in] <positive number> [steps]
palette inverse vertical gradient [from] <start colour> [to] <end colour> [in] <positive number> [steps]
palette tweak <colour> [{hue|h}] [<hue angle adjustment>] [{saturation|s}] [<saturation adjustment>] [{luminance|l}] [<luminance adjustment>] [<sample text>]
palette show <colour>

Description

The palette command can be used to help you find the perfect colours for all the many things on the Disc that have configurable colours. More importantly, it can also make pretty patterns on your screen.

Background

Internally this command operates in the HSL colour space. 'HSL' stands for 'Hue, Saturation, Luminance'. Imagine a circular cylinder that contains all possible colours. Hue is the angle around the cylinder, with pure red at 0 degrees, yellow at 60 degrees, green at 120, cyan at 180, blue at 240, magenta at 300, and back to red.

Luminance is a measure is how close to white or black a colour is. The bottom of our colour cylinder is completely black and has a luminance of 0. The top is pure white and has a luminance of 100.

Saturation is a measure of how close to being a shade of gray a colour is. Colours on the outer edge of our cylinder are as intense as they can be and have a saturation of 100. On the center axis of the cylinder, everything is a shade of gray from black to white and the saturation is 0.

As an example, if you start with pure red and increase the luminance it becomes a lighter and lighter pink. If you decrease the saturation it becomes a less and less red-tinted shade of gray.

Operation

As a general note for all syntaxes that include a colour, you can specify it either by name (eg, Orchid) or by #RRGGBB code (eg, #d75fd7). See 'help colour list' for a nice list of named colours.

This command operates in several different ways.

Grids

If your client supports MXP, the command can display a colour spectrum all neatly lined up in a block on your screen, starting with the most saturated colours and fading down to gray. You can then click on a colour to have the RGB code revealed. By default all the hues are used, from red through yellow, green, cyan, etc. back to red. You can also choose the two colours for the endpoints, but note that the supplied colours are only used to determine the starting and ending hues — they may not appear anywhere in the block themselves.

Normally the colours in each row are calculated along the shortest distance around the colour circle between the two endpoints. On the other hand if you include the 'inverse' keyword the gradient is calculated by going the long way around.

You can also choose the luminance value for the block, ranging from 0 to 100, or omit it in which case the default luminance is 50.

Gradients

You can generate a smooth gradient of colours between two endpoints. The syntaxes that do not include the 'vertical' keyword require your client to support MXP and will display a horizontal row of colours which are clickable to display their RGB codes. The syntaxes that DO include the the 'vertical' keyword don't require MXP support and will display the colours in a vertical column along with their RGB codes.

If you use the 'text' keyword the gradient will be applied to the sample text you supply, ignoring spaces. The string that would be used to display that text in-game is also shown, which can be used in making a custom title for your character. The 'text-and-spaces' keyword works similarly, except it also assigns colours to the space characters in case you want to use the colours as backgrounds. The length of the text is limited to 25 characters.

As with grids, by default the gradient is calculated along the shortest distance around the colour circle between the two endpoints, or the opposite direction if you include the 'inverse' keyword.

Adjustments

So you found a lovely shade of green but you wish that it was just a little bit more yellow or a tad brighter? The 'tweak' syntax will let you adjust the hue, saturation, or luminance values of a colour, in any combination, and show you the resulting new colour.

To let you know what your starting point is before making changes, the 'show' syntax will show you the RGB and HSL values for a colour.

Examples

Show a palette of colours
> palette

Show a palette of darker colours
> palette 35

Show a palette of colours with hues between RGB #FF8000 and DeepBlue
> palette #ff8000 deepblue
> palette inverse #ff8000 deepblue

Show a palette of darker colours with hues between RGB #FF8000 and DeepBlue
> palette #ff8000 deepblue 35
> palette inverse #ff8000 deepblue 35

Show a horizontal gradient of colours between Ivy and Envy in 40 steps
> palette gradient ivy envy 40
> palette inverse gradient ivy envy 40

Show a gradient of colours between BabyBlue and Fuchsia applied to the text "Hello there world!"

> palette text gradient BabyBlue Fuchsia Hello there world!
> palette inverse text gradient BabyBlue Fuchsia Hello there world!

Show a gradient of colours between BabyBlue and Fuchsia applied to the text "Hello there world!", including the spaces

> palette text-and-spaces gradient BabyBlue Fuchsia Hello there world!
> palette inverse text-and-spaces gradient BabyBlue Fuchsia Hello there world!

Show a vertical gradient of colours between RGB #D70000 and RGB #FFFF5F in 30 steps

> palette vertical gradient #D70000 #ffff5f 30
> palette inverse vertical gradient #D70000 #ffff5f 30

Show the RGB and HSL values for the colour Fandango
> palette show fandango

Adjust the colour Fandango to be a slightly redder and a little less saturated
> palette tweak fandango h 5 s -10

Adjust the colour Fandango to be a little less saturated and a fraction darker, and show the new colour using the sample text "Fuzzy womble ears"

> palette tweak fandango s -10 l -3.6 Fuzzy womble ears

See also

term, colour, colours, colour list, options, mxp