Difference between revisions of "Colors.combine"

From ComputerCraft Wiki
Jump to: navigation, search
m (Int linking fix.)
m (Fix wrong API name)
Line 3: Line 3:
 
|name=colors.combine
 
|name=colors.combine
 
|args=[[int (type)|int]] color1, [[int (type)|int]] color2, …
 
|args=[[int (type)|int]] color1, [[int (type)|int]] color2, …
|api=color
+
|api=colors
 
|returns=[[int (type)|int]] the union of sets <var>color1</var>, <var>color2</var>, …
 
|returns=[[int (type)|int]] the union of sets <var>color1</var>, <var>color2</var>, …
 
|addon=ComputerCraft
 
|addon=ComputerCraft

Revision as of 19:46, 21 April 2013


Grid Redstone.png  Function colors.combine
Computes the union of sets of colors; each parameter may be a single color or may be a set of colors
Syntax colors.combine(int color1, int color2, …)
Returns int the union of sets color1, color2, …
Part of ComputerCraft
API colors

Examples

Grid paper.png  Example
Combine white, magenta, and light blue to yield 13 (the bitwise combination of the colors)
Code
print(colors.combine(colors.white, colors.magenta, colours.lightBlue))
Output 13