Name ColourNameToRGB
Type Method
Summary Converts a named colour to a RGB colour code.
Prototype long ColourNameToRGB(BSTR Name);
Description Converts a named colour (eg. "brown") to an RGB colour code (eg. 2763429).

The colours can either be named (eg. "red", "blue", "green", "brown") or supplied as HTML colour codes (eg. "#010203"). For HTML colours, the leading "#" is required.

The list of colour names recognised can be found by using MUSHclient's "colour picker" (Ctrl+Alt+P), or by using the function:

world.debug "colours"


Note: Available in MUSHclient version 3.22 onwards.
VBscript example
world.note world.colourNameToRGB ("brown")
Jscript example
world.note (world.colourNameToRGB ("brown"));
PerlScript example
$world->note ($world->colourNameToRGB ("brown"));
Returns The RGB code of the converted colour, or -1 if the colour name is not recognised. Note that -1 cannot be an RGB colour (-1 is the hex sequence 0xFFFFFFFF, whereas the "highest" colour (white) is hex 0x00FFFFFF).

See also ...