Colors (API)

From ComputerCraft Wiki
Revision as of 19:21, 31 August 2012 by 86.135.72.57 (Talk)

Jump to: navigation, search

The Colors API allows you to mess with colors. For the non-American English Version just replace 'color' with 'colour' and it will use the other API, colours, which is exactly the same, except in non-American English (e.g. gray is spelt grey and lightGray is spelt 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.gray 128 0x80
colors.lightGray 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