world.CustomColourText

MUSHclient script function (Property)

Sets the RGB value for the text of a custom colour

Prototype

long CustomColourText(short WhichColour);
void CustomColourText(short WhichColour, long nNewValue);

Data type meanings

Description

You can use this property to get or set the RGB colours used for the text (foreground) of the 16 custom colours. You must specify *which* colour you want to get/set, in the range 1 to 16.

If you are setting the colour you must specify an RGB value. Some pre-defined values are available in VBscript, see below.

Constant Value Description
-------------------------------
vbBlack &h00 Black
vbRed &hFF Red
vbGreen &hFF00 Green
vbYellow &hFFFF Yellow
vbBlue &hFF0000 Blue
vbMagenta &hFF00FF Magenta
vbCyan &hFFFF00 Cyan
vbWhite &hFFFFFF White

In JScript you will need to use the RGB values, for example Magenta would be: 0xFF00FF.

You should be cautious doing frequent colour changes, because what happens is that you are changing the *palette* colour. What this means in practice is that if you change (say) the white colour (colour 8) then when new text appears on the screen it will be drawn in the new colour, however existing text will stay the old colour *until* it is redrawn (eg. is covered by a dialog box). This may lead to patchy bits of different colour on the screen.

You can have different colours on the screen (at the same time) by using the 16 custom colours, but only 16 different colours can be visible at once.

You can force a redraw of the whole world's window(s) by using the "Redraw" method.

See also NormalColour, BoldColour and CustomColourBackground.

VBscript example

world.note world.customcolourtext (10)
world.customcolourtext (14) = vbBlue

Jscript example

world.Note(world.customcolourtext(10));
world.customcolourtext(14) = 0xFF0000;

PerlScript example

$world->Note($world->customcolourtext(10));

Python example

world.Note(world.customcolourtext(10))
world.customcolourtext(14) = 0xFF0000

Lua example

Note(GetCustomColourText (10))
SetCustomColourText (14, ColourNameToRGB ("brown"))

Lua notes

Lua implements this as two functions:

GetCustomColourText - gets the custom colour text
SetCustomColourText - sets the custom colour text

Return value

This is a property. You can use it to find the current custom text colour.

Related topic

Colour management

See also

FunctionDescription
BoldColourGets/sets the RGB colour for one of the 8 ANSI bold colours
CustomColourBackgroundSets the RGB value for the background of a custom colour
GetCustomColourNameGets the name of a custom colour
NormalColourGets/sets the RGB colour for one of the 8 ANSI normal colours
SetCustomColourNameSets the name of a custom colour