Project written for with P5.js library. See the project live on p5js.org.
When you choose colours in a completely random way, the result is not always harmonious. The HSB color model (for Hue, Saturation, Brightness) rather than RGB allows, from one colour, to easily find colours that go well together.
The hsb-harmonic-color allows you to :
- choose a base colour (manually or randomly)
- display the colours that match the base colour in six different modes (complementary, analogous, split complementary, triadic, tetradic, square)
- by moving the mouse over the chosen colour you can see the values in RGB and HSB.
palette.js file contains all the elements to be integrated into another project. Examples of calls to palette.js are shown in sketch.js.
Original script from : Simon Tiger on p5js.org
See alsow : "WK9 HSB Random Analogous Hues Palette" by enickles on p5js.org
and
"HSB color mode - random" by sjnha on p5js.org
Further reading: Color schemes on "Programmingdesignsystems.com"
If these lines of code are useful to you or if you want to leave me a comment (always appreciated): contact me on Linktree
This is free software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. The Unlicense