Difference between revisions of "Colors (API)"
From ComputerCraft Wiki
(Changed "value" to "decimal") |
(→Colors: The previous spellings of grey are not valid and could cause crashes in your code.) |
||
Line 53: | Line 53: | ||
| align="right" | 0x40 | | align="right" | 0x40 | ||
|- | |- | ||
− | | colors. | + | | colors.grey |
| align="right" | 128 | | align="right" | 128 | ||
| align="right" | 0x80 | | align="right" | 0x80 | ||
|- | |- | ||
− | | colors. | + | | colors.lightGrey |
| align="right" | 256 | | align="right" | 256 | ||
| align="right" | 0x100 | | align="right" | 0x100 |
Revision as of 22:20, 8 August 2012
The Colors API allows you to mess with colors. For the British English Version just replace 'color' with 'colour' and it will use the other API, colours, which is exactly the same, except in British English (gray is grey and lightGray is lightGrey).
Methods
Method name | Description |
---|---|
colors.combine(color1, color2, …) | Combines a set of colors (or sets of colors) into a larger set |
colors.subtract(colors, color1, color2, …) | Removes one or more colors (or sets of colors) from an initial set |
colors.test(colors, color) | Tests whether a given color (or set of colors) is contained within a set |
Colors
Color constants include, in ascending bit order:
Color | Decimal | Hexadecimal |
---|---|---|
colors.white | 1 | 0x1 |
colors.orange | 2 | 0x2 |
colors.magenta | 4 | 0x4 |
colors.lightBlue | 8 | 0x8 |
colors.yellow | 16 | 0x10 |
colors.lime | 32 | 0x20 |
colors.pink | 64 | 0x40 |
colors.grey | 128 | 0x80 |
colors.lightGrey | 256 | 0x100 |
colors.cyan | 512 | 0x200 |
colors.purple | 1024 | 0x400 |
colors.blue | 2048 | 0x800 |
colors.brown | 4096 | 0x1000 |
colors.green | 8192 | 0x2000 |
colors.red | 16384 | 0x4000 |
colors.black | 32768 | 0x8000 |