mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Added README section for lume.color()
This commit is contained in:
parent
a753f6e9a2
commit
84e23cb82c
11
README.md
11
README.md
@ -412,6 +412,17 @@ for i, v in lume.ripairs({ "a", "b", "c" }) do
|
||||
end
|
||||
```
|
||||
|
||||
### lume.color(str [, mul])
|
||||
Takes color string `str` and returns 4 values, one for each color channel (`r`,
|
||||
`g`, `b` and `a`). By default the returned values are between 0 and 1; the
|
||||
values are multiplied by the number `mul` if it is provided.
|
||||
```lua
|
||||
lume.color("#ff0000") -- Returns 1, 0, 0, 1
|
||||
lume.color("rgba(255, 0, 255, .5)") -- Returns 1, 0, 1, .5
|
||||
lume.color("#00ffff", 256) -- Returns 0, 256, 256, 256
|
||||
lume.color("rgb(255, 0, 0, 1)", 256) -- Returns 256, 0, 0, 256
|
||||
```
|
||||
|
||||
### lume.rgba(color)
|
||||
Takes the 32bit integer `color` argument and returns 4 numbers, one for each
|
||||
channel, with a range of 0 - 255. The returned values can be used as the
|
||||
|
Loading…
Reference in New Issue
Block a user