Difference between revisions of "Color (API)"

From ComputerCraft Wiki
Jump to: navigation, search
m
Line 1: Line 1:
 
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).
 
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=
+
==Methods==
 
{| border="1" cellpadding="2" cellspacing="0"
 
{| border="1" cellpadding="2" cellspacing="0"
 
!style="background:#EEE" width="200px"|Method name
 
!style="background:#EEE" width="200px"|Method name
Line 16: Line 16:
 
|}
 
|}
  
=Colors=
+
==Colors==
 
Color constants include, in ascending bit order:
 
Color constants include, in ascending bit order:
  

Revision as of 12:09, 29 May 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 Value
colors.white 1
colors.orange 2
colors.magenta 4
colors.lightBlue 8
colors.yellow 16
colors.lime 32
colors.pink 64
colors.gray 128
colors.lightGray 256
colors.cyan 512
colors.purple 1024
colors.blue 2048
colors.brown 4096
colors.green 8192
colors.red 16384
colors.black 32768