Open maximal opened 9 years ago
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.
Thanks for your suggestion. I have no time to develop this recently. You can try it by yourself first.
It’s better to draw gradients when different branches merge (so the color changes). Otherwise colors are changing roughly.