MCPcopy Index your code
hub / github.com/clips/pattern / darker

Function darker

pattern/canvas.js:812–819  ·  view source on GitHub ↗
(clr, step)

Source from the content-addressed store, hash-verified

810}
811
812function darker(clr, step) {
813 /* Returns a copy of the color with a darker brightness.
814 */
815 if (step === undefined) step = 0.2;
816 var hsb = _rgb2hsb(clr.r, clr.g, clr.b);
817 var rgb = _hsb2rgb(hsb[0], hsb[1], Math.max(0, hsb[2]-step));
818 return new Color(rgb[0], rgb[1], rgb[2], clr.a);
819}
820
821function lighter(clr, step) {
822 /* Returns a copy of the color with a lighter brightness.

Callers

nothing calls this directly

Calls 2

_rgb2hsbFunction · 0.85
_hsb2rgbFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…