Difference between revisions of "Color (API)"

From ComputerCraft Wiki
Jump to: navigation, search
m
(Redirected page to Colors (API))
 
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).
+
#REDIRECT [[Colors_(API)]]
 
+
==Methods==
+
{| border="1" cellpadding="2" cellspacing="0"
+
!style="background:#EEE" width="200px"|Method name
+
!style="background:#EEE" width="*"|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:
+
 
+
{| class="wikitable" width="200px"
+
! Color
+
! Value
+
|-
+
| colors.white
+
| align="right" | 1
+
|-
+
| colors.orange
+
| align="right" | 2
+
|-
+
| colors.magenta
+
| align="right" | 4
+
|-
+
| colors.lightBlue
+
| align="right" | 8
+
|-
+
| colors.yellow
+
| align="right" | 16
+
|-
+
| colors.lime
+
| align="right" | 32
+
|-
+
| colors.pink
+
| align="right" | 64
+
|-
+
| colors.gray
+
| align="right" | 128
+
|-
+
| colors.lightGray
+
| align="right" | 256
+
|-
+
| colors.cyan
+
| align="right" | 512
+
|-
+
| colors.purple
+
| align="right" | 1024
+
|-
+
| colors.blue
+
| align="right" | 2048
+
|-
+
| colors.brown
+
| align="right" | 4096
+
|-
+
| colors.green
+
| align="right" | 8192
+
|-
+
| colors.red
+
| align="right" | 16384
+
|-
+
| colors.black
+
| align="right" | 32768
+
|}
+
[[Category:APIs]]
+

Latest revision as of 13:15, 5 July 2012

Redirect to: