Skip to content

Instantly share code, notes, and snippets.

@behreajj
Last active June 25, 2017 16:53
Show Gist options
  • Save behreajj/80597cc3fe83cac5203b305ede4eb99d to your computer and use it in GitHub Desktop.
Save behreajj/80597cc3fe83cac5203b305ede4eb99d to your computer and use it in GitHub Desktop.
Color Gradients 2-4
void addColorStop(ColorStop cs) {
ColorStop other;
for (int i = 0, sz = colors.size(); i < sz; ++i) {
other = colors.get(i);
if (cs.approximates(other, Gradient.TOLERANCE)) {
println(cs, "percentage is too close to", other);
return;
}
}
colors.add(cs);
java.util.Collections.sort(colors);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment