randomColor – A color generator for JavaScript

There are lots of clever one-liners for generating random colors: ‘#’+Math.floor(Math.random()*16777215).toString(16); Unfortunately, this code naturally produces lots of greys and browns and murky greens. randomColor generates attractive colors by default. More specifically, randomColor produces bright colors with a reasonably high saturation. This makes randomColor particularly useful for data visualizations and generative art. The result pictured …

Reminder: Current Color in CSS

Reminder to self, as I seem to keep forgetting this (even after having blogged about it 3 years ago): you can use currentColor as a color value in CSS. Be it for background-color, border-color, etc. — they all accept currentColor. The value it represents is the current color, so if that one changes so will …

Paper’s Color Mixer

Paper by 53 (recommended app) now sports an innovative color mixer / color picker. Turns out it was quite a mathematical struggle to implement it too. We learned in elementary school that yellow and blue when mixed turn green. However when you plug in the values to this equation, you get a different result: Gray! …