jeffcarp / rcrd

A human memory exoskeleton
https://www.rcrd.org/
6 stars 2 forks source link

Colors #15

Closed intelliot closed 8 years ago

intelliot commented 9 years ago

What determines the colors? They don't seem to be consistent (records shows a cat in one color, while cats shows it in a different one, even within the same page). Also, colors appear to differ between rcrd.org and localhost.

jeffcarp commented 9 years ago

My idea was that the color of a records' cats would correspond to the time of day, so that if you were looking at all your workouts, for example, you could tell at a glance whether they clustered around a certain time. The implementation of this, as you discovered, is not consistent or complete. The function that converts time of day into a 0-255 hue value is here: https://github.com/jeffcarp/rcrd/blob/master/app/helpers/application_helper.rb#L6

jeffcarp commented 8 years ago

Colors are now determined by converting individual category strings into a number between 0 and 255, which is given to the hue part of a hsl() CSS rule: https://github.com/jeffcarp/rcrd/blob/master/browser/util.js#L51 https://github.com/jeffcarp/rcrd/blob/master/browser/cat.js#L35

It ends up looking like this:

screen shot 2016-03-29 at 2 44 42 pm

(If you know of a smarter way to do this please let me know)

(Also there are no docs on running the repo in its current state so if you're interested in getting it up and running let's pair)