RAINCOLORS.LUA
A color manipualtion library that includes color theory and harmony functions
A color manipualtion library that includes color theory and harmony functions
So, after some days working in this, finally I feel comfortable to share what is the first version of the (now named) raincolors.lua.
This is my first time doing stuff in lua so there might be things that can be optimized and I would love anyone who points at any error, bug, or possible improvement, also new functions ideas are welcomed. I prepared 5 basic skins as examples.
What if I told you that you can create themes choosing only one color?
adjustContrast() and complementary() functions in use
Raincolors.lua contains a handful of functions to control how a skin looks, from simple color manipulation functions like shiftHue, shiftSat, and shiftLight to functions that read the contrast between 2 colors and easily return an enhanced color for better readability, others that will generate a quantity of shades, tints and tones from any color and others that will generate colors according to color theory and harmony. While by themselves won't do magic, with your helping hand I'm pretty sure they'll do miracles (Aight, I might be exaggerating.. or not? ).
Content
Functions like shades tints and tones will let you generate any quantity of color variations to do whatever you want to do with them.
Functions like splitComplementary, analogous, triadic, tetradic, and square will let you use color theory to give some life to your skins.
Using only conversion and splitting functions you can make a functional color selector.
What you can or can't do with these is up to your creativity. So, stay creative!
On this package you'll find 5 examples and raincolors.lua script.
Changelog
- Version1.2.18.03.24
- Added function round(number, ndp)
- Now returns are rounded to 2 decimal places for better accuracy.
- Renamed functions saturation(color, amount), lightness(color, amount) and hue(color, angle) to setSat(color, newSat), setLight(color, newLight) and setHue(color,newHue)
- Renamed functions RGB(HEX), HEX(color), HSL(color) to RGB2HSL(color), HSL2RGB(HSL), RGB2HEX(color), HEX2RGB(HEX)
- Added functions red(color),green(color),blue(color), h(color), s(color) and l(color) which return a single value.
- Added BasicColorSelector example skin.
- Improved Themes example skin.
- Adapted all other example skins to new changes.
Version1.1.11.03.24 - Fixed typo on hue('color') function that was causing it to not behave properly.
Version 1.1.10.03.24 - Deleted functions saturate(), desaturate(), brighten() and darken()
- Added functions hue('color',newHue), saturation('color',newSat) and lightness('color',newLight)
Those functions were doing practically the same as the shift functions, these new functions will fix the hue, saturation or lightness values to a new given value which allows for better control. - Renamed colorBrightness() function to brightness()
- Renamed colorHSL(), colorRGB() and colorHEX() functions to HSL(),RGB() and HEX()
- Small changes to example skins.
- Added new Themes example skin.
- Added support to input HEX colors.
Version 1.0.09.03.24 - Released
Not sure yet.