Colorswatches was created circa 2005 when I was using Plua to develop software for Palm OS devices. I resurrected it recently (summer 2014) because I needed something similar while developing the blink library for Lua.
If I really wanted to beat a dead horse, there are a number of other color collections I could implement such as the ones at Rapid Tables, or the list of Crayola colors.
colors = require 'colorswatches'
c = colors.red -- or colors['red']
print(c.name, c.r, c.g, c.b)
print(c) -- make use of Color's __tostring
print(c:rgb()) -- rgb() returns multiple values
myred = colors.new('AwesomeRed', 240, 12, 14)
This project uses semantic versioning. See semver.org for more information.
The library was developed and tested using Lua 5.2.3. However it should run on other versions of Lua with little or no modification.
If you have downloaded the github repository, you can install the library by copying the files in the src
subdirectory to
your Lua library (/usr/local/share/lua/5.2
or similar). Alternatively, you can install it via luarocks
luarocks install colorswatches
More documentation (than this dirt simple library requires) can be found in the doc
subdirectory.
The best way to contact me regarding this library is to post an issue at the github repository.
Colorswatches is free software distributed under the terms of the MIT license. It may be used for any purpose, including commercial purposes, at absolutely no cost without having to ask us. The only requirement is that if you do use Colorswatches, then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation. For details, see LICENSE
.