Skip to content

Instantly share code, notes, and snippets.

@dahse89
Created April 18, 2017 16:08
Show Gist options
  • Save dahse89/215b7d31a032eee5e4ba4581c1fe89cb to your computer and use it in GitHub Desktop.
Save dahse89/215b7d31a032eee5e4ba4581c1fe89cb to your computer and use it in GitHub Desktop.
let M = 255;
let C = (x,y) => (M - Math.sqrt((Math.pow(M-x,2)+Math.pow(M-y,2))/2)).toFixed(0);
let mixColors = (x,y) => [C(x[0],y[0]),C(x[1],y[1]),C(x[2],y[2])];
mixColors([255,125,23],[0,255,0]) // ["75","163","11"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment