From ComputerCraft Wiki
Revision as of 00:44, 12 July 2013 by Watcher7 (Talk | contribs) (Int -> {{type|number}} (Boo! I missed one!))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Grid Redstone.png  Function colors.subtract
Removes one or more colors (or sets of colors) from an initial set; each parameter beyond the first may be a single color or may be a set of colors (in the latter case, all colors in the set are removed from the original set).
Syntax colors.subtract(number colors, number color1, number color2, …)
Returns number the set colors after removing sets color1, color2, …
Part of ComputerCraft
API colors


Grid paper.png  Example
Beginning with white, magenta, and light blue, remove magenta to yield 9 (the bitwise combination of white and light blue)
print(colors.subtract(colors.combine(colors.white, colors.magenta, colours.lightBlue), colors.magenta))
Output 9