G.Color
From GMod Wiki
| Function | |
| Syntax |
Color( integer red, integer green, integer blue, integer alpha ) Where is this used? |
| Description: | |
| Returns a color structure. Red, green, and blue describe the color, and alpha describes the opacity. | |
| Returns: | Color |
| Part of Library: | Global Functions |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.Color]G.Color [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Create a half-visible yellow color. |
|---|---|
| Used on | |
| Code | local transYellow=Color( 255, 255, 0, 127 ) |
| Output | Color |
Additional Notes
- alpha is optional and defaults to 255.
- Red, green, blue, and alpha range between 0 - 255. If the given values are out of this range, they are clamped automatically.
- This is primarily used for clientside draw functions.
- The function uses tonumber on all arguments. This means string arguments work as well. Source: http://luabin.foszor.com/code/lua/includes/util.lua#20