1
0
Bunch of color utilities for Lua.
Go to file
takunomi-build-bot 64d317ffcd
Some checks failed
LÖVE/Lua Library / Lua-Testing (push) Failing after 8s
LÖVE/Lua Library / Static-Analysis (push) Failing after 4s
🤖 Bumped version to 1.0.11
This commit was automatically generated by [a script](https://gitfub.space/Jmaa/repo-manager)
2025-04-20 17:42:38 +02:00
.gitea/workflows 🤖 Repository layout updated to latest version 2025-04-20 17:42:34 +02:00
test Dummy test 2025-04-17 16:18:19 +02:00
.gitignore 🤖 Repository layout updated to latest version 2025-04-17 17:04:38 +02:00
.luacheckrc 🤖 Repository layout updated to latest version 2025-04-17 16:17:17 +02:00
colors.lua 🤖 Bumped version to 1.0.11 2025-04-20 17:42:38 +02:00
init.lua 🤖 Repository layout updated to latest version 2025-04-17 16:23:56 +02:00
LICENSE 🤖 Repository layout updated to latest version 2025-04-17 16:17:17 +02:00
README.md 🤖 Repository layout updated to latest version 2025-04-17 16:17:17 +02:00

Colors

This is a collection of functions for performing color operations, designed to work with the LÖVE game engine.

Documentation

Supports following color formats:

  • rgb255: The standard computer representation, with each
channel (red, green, blue, alpha) in the [0-255] range. Alpha
channel (index 4), can either be explicit or implicit (and taken
to be 255.)
  • rgb1: As above, except channels are in the [0-1] range.
  • hsl: Hue-saturation-lightness representation (does not support alpha).
Hue channel is in the [0-1] range, instead of the standard [0-2*pi] range.

Functions

interpolate_rgb (c1, c2, t) Interpolation

invert_rgb (color) Inversion

parse_rgb (str) Parsing

Functions

interpolate_rgb (c1, c2, t)

Interpolation

Parameters:

c1

c2

t

invert_rgb (color)

Inversion

Parameters:

color

parse_rgb (str)

Parsing

Parameters:

str Error handling

Dependencies

This project requires PUC Lua 5.1 or LuaJIT. Newer versions of PUC Lua are not supported.

This project does not have any library requirements 😎

Contributing

Feel free to submit pull requests. Please follow the Code Conventions when doing so.

License

MIT License

Copyright (c) 2017-2025 Jon Michael Aanes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.