Difference between revisions of "Legacy:CreateColor"
From Spherical
(added navbox) |
Bruce Pascoe (talk | contribs) (→Usage) |
||
Line 3: | Line 3: | ||
==Usage== | ==Usage== | ||
+ | <center>'''Sphere 1.0 API'''</center> | ||
{{Usage|func=CreateColor|params=r, g, b, a}} | {{Usage|func=CreateColor|params=r, g, b, a}} | ||
+ | <center>'''Sphere 2.0 API'''</center> | ||
+ | {{Usage|func=new Color|params=r, g, b, a}} | ||
* '''r''' the red component | * '''r''' the red component |
Revision as of 04:55, 20 June 2015
Returns a Sphere Color Object, to be used in color masks or drawing primitives.
Contents
Usage
CreateColor(r, g, b, a);
new Color(r, g, b, a);
- r the red component
- g the green component
- b the blue component
- a the alpha component
Notes
The alpha component is optional. By default it's complete opaque (255).
Examples
Create some colors:
var Red = CreateColor(255, 0 , 0);
var Green = CreateColor(0 , 255, 0);
var Yellow = CreateColor(255, 255, 0);
var TransparentRed = CreateColor(255, 0, 0, 125);
See also
- Sphere Color Object
- Line(x1, x2, y1, y2, color)
- Point(x, y, color)
- Rectangle(x, y, width, height, color)
- Image.blitMask(x, y, color)
- FlipScreen()