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 for Lectures and Discussion sections #63

Open
tr3ndy-bear opened this issue Nov 19, 2019 · 0 comments
Open

Colors for Lectures and Discussion sections #63

tr3ndy-bear opened this issue Nov 19, 2019 · 0 comments

Comments

@tr3ndy-bear
Copy link

Right now, when you add a class, it picks a random color. It looks like it does this with the function getRandomColorPair() in antplanner2.js

I think it would look a lot neater if the color of the discussions looked a lot more similar to the classes they're similar too. Since lectures and their discussions usually have similar class codes (i.e. lecture code is 45200 and discussion is 45201), you could instead generate a color based on that. This would make it so that similar classes are more likely to have similar colors

One simple way you could do this is to simply round 45200 to it's lowest 5, multiply it by 16, and then convert that number to its hex code.

(the max value of a hex code is 16777216)

Some examples:
20000 -- > #04e200 (lime)
63010 --> #0f2828 (dark turquoise)
63014 --> #0f2828
70010 --> #1118e0 (strong blue)
99999 --> #f423f0 (strong purple)

You can obviously tweak it in a lot of ways tho. If you make the alpha value big enough I think all colors would work. I'm not really familiar with Javascript, but if there's a simple way to mess HSL instead of hex codes, that approach might be more fruitful as well

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

1 participant