Cover photo by Ana Cruz via unsplash.
I was told to talk about my pet projects:
Pet projects, the secret to keep yourself updated
Yaser Adel Mehraban ・ Jun 9 '19 ・ 4 min read
So here goes nothing...
Sorting colors! It can't be done--well, not perfectly. Colors are represented in a 3d space, and the type of sort here is represented linearly, and that's just not going to look quite right no matter how you slice it.
RGB Colorspace representation, sourced from Wikipedia
HSV Colorspace representation, sourced again from Wikipedia
What even is colors? How can colors be real if our eyes aren't even real?
The question I want to ask is: Which way is least bad?
It's great, because literally nobody cares about this but me. I can nerd out about color all I like.
So far in setting this up, I've learned a lot about modern build methods and how much I don't care to use them on a project spanning approximately a dozen files. They add an awful lot of work and restriction to the stack and setup of a project, and it ended up not being worth it for what ended up being two lines of code in a shell file run from Atom.
I also am putting an arbitrary constraint on myself to see if I can finish it without including any dependencies as packages. We all joke about node_modules
, right? At time of writing, the external loads are a font and jQuery (I know, I know, it's date('Y')
, shh), and other than that it's just sass and minify installed globally. I'd like to challenge myself to keep this lean.
I also refreshed myself on ye olde jQuery. It's been awhile. Like meeting an old friend again. It's changed a bit since I last saw it!
It's not done yet, but if you happen to want to take a look at this while its guts are still all over the floor, here it is:
https://tchaflich.github.io/color-sorts/
Top comments (0)