Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created May 28, 2021 09:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutterer/bdca9d6ffe91ea0bbdc080fba0892f79 to your computer and use it in GitHub Desktop.
Save mutterer/bdca9d6ffe91ea0bbdc080fba0892f79 to your computer and use it in GitHub Desktop.
creates a linear lookup table between color a and color b
run("Boats");
makeLut("#009100","#ccff42");
function makeLut(a,b) {
a = Color.toArray(a);
b = Color.toArray(b);
reds=newArray(256);
greens=newArray(256);
blues=newArray(256);
for (i=0;i<reds.length;i++) {
reds[i] = a[0]+i*(b[0]-a[0])/256;
greens[i] = a[1]+i*(b[1]-a[1])/256;
blues[i] = a[2]+i*(b[2]-a[2])/256;
}
setLut(reds,greens,blues);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment