term.setPaletteColour
Sets the RGB value of the specified palette colour of the terminal object. This allows you to change the appearance of all text and background using this colour.
| term.setPaletteColour Function | |
|---|---|
|
Syntax term.setPaletteColour(
term.setPaletteColour(
| |
| Returns | nil |
| API | term |
| Source | CC:Tweaked (source) |
The first argument is the colour that you want to change, e.g. colours.red. The arguments after that can either be:
- An integer representing the hexadecimal RGB8 value of the colour, e.g.
0xFF0000to produce the colour . - Three floats (0–1) representing the red, green and blue channels individually, e.g.
1.0, 0.0, 0.0to produce the colour .
|
|||
| Changes the red colour from the default (#cc4c4c) to #FF0000. | |||
| Code | <nowiki>
term.setPaletteColour(colours.red, 0xFF0000)
term.setTextColour(colours.red)
print("Hello, world!")
</nowiki>
|
||
| Output | |||
|
|||
| Changes the red colour from the default (#cc4c4c) to #FF0000. | |||
| Code | <nowiki>
term.setPaletteColour(colours.red, 1, 0, 0)
term.setTextColour(colours.red)
print("Hello, world!")
</nowiki>
|
||
| Output | |||
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.