Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colors #15

Closed
intelliot opened this issue Mar 28, 2015 · 2 comments
Closed

Colors #15

intelliot opened this issue Mar 28, 2015 · 2 comments

Comments

@intelliot
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants