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

Function adjust_hue

pattern/canvas.js:3107–3113  ·  view source on GitHub ↗
(pixels, m)

Source from the content-addressed store, hash-verified

3105 */
3106 var pixels = new Pixels(img);
3107 var adjust_hue = function(pixels, m) {
3108 pixels.map(function(p) {
3109 var hsb = _rgb2hsb(p[0]/255, p[1]/255, p[2]/255);
3110 var rgb = _hsb2rgb(Math.clamp((hsb[0] + m) % 1, 0, 1), hsb[1], hsb[2]);
3111 return [rgb[0]*255, rgb[1]*255, rgb[2]*255, p[3]];
3112 });
3113 }
3114 var adjust_saturation = function(pixels, m) {
3115 pixels.map(function(p) {
3116 var i = (0.3*p[0] + 0.59*p[1] + 0.11*p[2]) * (1-m);

Callers 1

adjustFunction · 0.85

Calls 3

_rgb2hsbFunction · 0.85
_hsb2rgbFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…