Difference between revisions of "Colors.combine"

From ComputerCraft Wiki
Jump to: navigation, search
m (Fix wrong API name)
m (Int -> {{type|number}})
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=colors.combine
 
|name=colors.combine
|args=[[int (type)|int]] color1, [[int (type)|int]] color2, …
+
|args={{Type|number}} color1, {{Type|number}} color2, …
 
|api=colors
 
|api=colors
|returns=[[int (type)|int]] the union of sets <var>color1</var>, <var>color2</var>, …
+
|returns={{Type|number}} the union of sets <var>color1</var>, <var>color2</var>, …
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Computes the union of sets of colors; each parameter may be a single color or may be a set of colors
+
|desc=Combines a set of colors (or sets of colors) into a larger set.
 
|examples=
 
|examples=
 
{{Example
 
{{Example

Latest revision as of 00:46, 12 July 2013


Grid Redstone.png  Function colors.combine
Combines a set of colors (or sets of colors) into a larger set.
Syntax colors.combine(number color1, number color2, …)
Returns number 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