Created
April 18, 2017 16:08
-
-
Save dahse89/215b7d31a032eee5e4ba4581c1fe89cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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