Defold Color
Library to modify, transform and convert colors. To use defined named colors and paletts, generate random colors and get a random palett.
There are a few modules in it to help with anything color. Here’s a quick overview!
color.lua
Convert to and from different color modes. Supports hex
, hsv
, and rgba
.
The to_*
methods takes vectors and the from_*
returns vectors.
harmony.lua
Pick your method and a color and it will give you the colors it harmonizes with, you have a few methods to choose from:
complementary, monochromatic, analogous, split_complementary, triadic and tetradic.
If these are just weird words to use I you can always use the example in the project to check them out, but here are some examples. The color the furthest left is the input color.
math.lua
Simple color math made simpler. Can help you invert colors, get the difference, screen them together, overlay them or a few other convenient things.
palette.lua
Contains a few “ready for you” palette that I think looks nice with some words I though fit.
w3c.lua
Contains all colors from w3c (sometimes called css or html colors). You can go to something like HTML Color Names pick a color name you like and use that directly without having to memorize any color values or hex codes.
0.2.0
Changes
-
color.overlay
Now uses a better algorithm, closer resembles PS. - Fixed type hints.
- Added
color.shift
- Added blendmodes
color_dodge
,color_burn
,linear_dodge
, andlinear_burn
color.shift(color, value)
Shifts the given color (the hue) a percentage (float number format) around the color wheel. If no value is provided it shifts a random amount of 1 to 2 percent.