FxColor โ
This module contains functions for creating and editing colors.
Load โ
lua
FxColor = require "FxColor";Functions โ
| Function | Description |
|---|---|
| CreateFromHex (Hex) | Returns a color created from a hexadecimal string. |
| CreateFromRGB (R, G, B) | Returns a color created from RGB values. |
| GetR (Color) GetG (Color) GetB(Color) | Return the color channel value of a color. |
| SetR (Color, Value) SetG(Color, Value) SetB(Color, Value) | Set the color channel value of a color. |
CreateFromHex (Hex) โ
This function returns a color created from a hexadecimal string.
Parameters โ
- Hex: hexadecimal string with optional leading
#
Returns โ
The new color
Since โ
Version 1.0
Example โ
lua
color = FxColor.CreateFromHex("e6482e");CreateFromRGB (R, G, B) โ
This function returns a color created from RGB values.
Parameters โ
- R: The red channel value
- G: The green channel value
- B: The blue channel value
Returns โ
The new color
Since โ
Version 1.0
Example โ
lua
color = FxColor.CreateFromRGB(230, 72, 46);GetR (Color)
GetG (Color)
GetB (Color) โ
These functions return the color channel value of the specified color.
Parameters โ
- Color: The color value
Returns โ
Value of a color channel depending on the function used
Since โ
Version 1.0
Example โ
lua
color = FxColor.CreateFromHex("e6482e");
r = FxColor.GetR(color); -- the value of r is 230SetR (Color, Value)
SetG (Color, Value)
SetB (Color, Value) โ
These functions set the color channel value of the specified color and return the new color.
Parameters โ
- Color: The color value
- Value: The new color channel value
Returns โ
The new color
Since โ
Version 1.0
Example โ
lua
color = FxColor.CreateFromHex("e6482e");
color = FxColor.SetR(color, 200);