HSLuv - Human-friendly HSL
The reference implementation is written in Haxe.
Building
Requirements: Nix package manage. If you want to build without Nix,
see default.nix
for dependencies and command line instructions.
The necessary mathematical equations are solved in Maxima.
See /math
directory for the equations and run the following to verify the solutions:
nix-build -A maximaOutput
To run full test suite:
nix-build -A test
To build JavaScript distributions (Node.js and browser):
nix-build -A nodePackageDist
nix-build -A browserDist
To build website:
nix-build -A website
To build website and start localhost server:
./run.sh server
Testing
The snapshot file is stored for regression testing. If a backwards-incompatible change is made, a new snapshot file can be generated as follows:
nix-build -A snapshotJson
The format of the file is as follows:
{
"#000000": {
rgb: [ 0, 0, 0 ],
xyz: [ 0, 0, 0 ],
luv: [ 0, 0, 0 ],
lch: [ 0, 0, 0 ],
hsluv: [ 0, 0, 0 ],
hpluv: [ 0, 0, 0 ]
},
...
}
Deploying
For publishing packages and website you will need access to our shared credentials.
./run.sh publishPypi
./run.sh publishNpmJs
./run.sh publishNpmSass
./run.sh publishLua
./run.sh publishWebsite
./run.sh publishRuby
./run.sh publishNuget
./scripts/publish-maven.sh
Versioning
Following semantic versioning, the major version must be incremented whenever the color math changes. These changes can be tested for with snapshot files.