Lua Scripts


NerArth’s Libraries: X11 Colours

A small script that allows you to do something like Color = require(“nal_color”) which you can then use such as object.color = Color.beige. I made this library so that I didn’t need to constantly have to look up what the RGB of a colour was to then define and use it.

The image above was created with Love2D using the colour library. The colours on the image are currently not sorted, but will be in a future version. Use this image or the link provided inside the script for a visual reference to each colour’s name.

Color.colorname is a table, such as {1,0,0} (which would be Red), with R,G,B keys and values between 0 and 1 for each of the keys. In the library the values are defined by a more human-readable function between 0 and 255, in case you want to add custom values to the library yourself.

More detailed instructions can be found inside the script itself, as well as the MIT copyright license.