Color
From GMod Wiki
Structure | |
Name | Color |
Available On: | |
Description: | |
Stores color data. Created with Color(r,g,b,[a]) |
Members
Type | Name | Description |
---|---|---|
Integer | r | The red value of the color. |
Integer | g | The green value of the color. |
Integer | b | The blue value of the color. |
Integer | a | The alpha (opacity) of the color. |
Examples
Description | Create team 4 with name "Guests" and color blue |
---|---|
Used on | |
Code | team.SetUp (4, "Guests", Color (0, 0, 255, 255)) |
Output | None |
Additional Notes
- A color can be created by typing Color(r,g,b,a).
- r,g,b, and a are all integers that range from 0 to 255.
- A color uses the red, green, and blue values to describe the color of something, but also contains an alpha value to describe how opaque something is. 255 is fully visible (opaque), 0 is fully invisible (transparent).
- Be aware that after a color is created[1], you shouldn't assume that r, g, b, and a are still integers ranging from 0 to 255. Colors are just tables - when the values in them are changed by a script, they are not fixed by Garry's Mod, unlike Angles. You could even set the r, g, b, or a of a color to nil or an Entity, and Garry's Mod would do nothing about this.
- If you want a awesome generator that prints colors in (r,g,b), Go here[2]