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

Gradient Bezier curves #3

Open
maximal opened this issue Sep 4, 2015 · 2 comments
Open

Gradient Bezier curves #3

maximal opened this issue Sep 4, 2015 · 2 comments

Comments

@maximal
Copy link

maximal commented Sep 4, 2015

It’s better to draw gradients when different branches merge (so the color changes).
Otherwise colors are changing roughly.

@maximal
Copy link
Author

maximal commented Sep 4, 2015

I tried different variations, like:

var grad = ctx.createLinearGradient(from_x, from_y, to_x, to_y);
grad.addColorStop(0, self.commit.graph.get_color(self.commit.routes[0].branch));
grad.addColorStop(1, self.commit.graph.get_color(self.commit.routes[self.commit.routes.length - 1].branch));
//grad.addColorStop(1, self.commit.graph.get_color(self.branch));

ctx.strokeStyle = grad;

But inside the Route class there’s no information about branches of both sides of the curve (in order to calculate colors). Or my JS skills are just failing me.

@tclh123
Copy link
Owner

tclh123 commented Sep 8, 2015

Thanks for your suggestion. I have no time to develop this recently. You can try it by yourself first.

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