For playing with colors.
local Color = require('stdlib/color/color')
from_hex (hex[, alpha=1]) | Get a color table with a hexadecimal string. |
from_rgb ([r=0][, g=0][, b=0][, a=255]) | Converts a color in the rgb format to a color table |
set ([color=white][, alpha=1]) | Set a value for the alpha channel in the given color table. |
to_table (c_arr) | Converts a color in the array format to a color in the table format. |
Get a color table with a hexadecimal string.
Optionally provide the value for the alpha channel.
Parameters:Converts a color in the rgb format to a color table
Parameters:
Set a value for the alpha channel in the given color table.
color.a
represents the alpha channel in the given color table.
color.a
to it.
color.a
, set color.a
to 1.
color.a
, then leave color.a
alone.