Difference between revisions of "Color (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(Better descriptions)
(Tidy parameter list a bit)
Line 6: Line 6:
 
!style="background:#EEE" width="*"|Description
 
!style="background:#EEE" width="*"|Description
 
|-
 
|-
|[[colors.combine]]( color1, color2, color3, so on)
+
|[[colors.combine]](color1, color2, )
 
|Combines a set of colors (or sets of colors) into a larger set
 
|Combines a set of colors (or sets of colors) into a larger set
 
|-
 
|-
|[[colors.subtract]]( colors, color1, color2, so on)
+
|[[colors.subtract]](colors, color1, color2, )
 
|Removes one or more colors (or sets of colors) from an initial set
 
|Removes one or more colors (or sets of colors) from an initial set
 
|-
 
|-
|[[colors.test]]( colors, color )
+
|[[colors.test]](colors, color)
 
|Tests whether a given color (or set of colors) is contained within a set
 
|Tests whether a given color (or set of colors) is contained within a set
 
|}
 
|}

Revision as of 23:19, 11 March 2012

The Colors API allows you to mess with colors. For the British just replace 'color' with 'colour' and it will use the other API, colours, which is just a British version.

Its functions are:

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

Color constants include, in ascending bit order:

  • colors.white
  • colors.orange
  • colors.magenta
  • colors.lightBlue
  • colors.yellow
  • colors.lime
  • colors.pink
  • colors.gray
  • colors.lightGray
  • colors.cyan
  • colors.purple
  • colors.blue
  • colors.brown
  • colors.green
  • colors.red
  • colors.black