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 match when they should not #986

Open
jesshart opened this issue Jul 22, 2022 · 2 comments
Open

Colors match when they should not #986

jesshart opened this issue Jul 22, 2022 · 2 comments

Comments

@jesshart
Copy link

First of all, incredible work here. A fantastic web app for learning Git.

It looks like colors may be randomly rendered for examples to distinguish one branch from another. However, sometimes the same color is rendered for different branches:
Screen Shot 2022-07-22 at 1 43 38 PM

@pcottle
Copy link
Owner

pcottle commented Jul 22, 2022

Yeah there's a chance, I think I didn't handle the collision case. Open to reviewing a PR if you have any ideas though!

@AjayLiu
Copy link

AjayLiu commented Jul 23, 2022

I was trying to see if I could tinker with the color generation but it's crazy! Note to those who want to try this, the color generation is in src/visuals/index.js, not src/visuals/visBranch.js like I thought for a good 2 hours lol!

I saw this comment in the code and it gave me a good chuckle:

// crap! convert
var color = Raphael.color(fill);
fill = 'hsb(' + String(color.h) + ',' + String(color.l);
fill = fill + ',' + String(color.s) + ')';

I'm new to open source but I'd love to contribute to this project! I'm just a little confused since the colors get converted and blended so much lol

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

3 participants