Created
February 26, 2020 08:40
-
-
Save gpprojekt-marcin/03c590888d6950c185086a6d930f2ff1 to your computer and use it in GitHub Desktop.
Color unBlender/unMixer
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
function unblendColorChanel(value, opacity){ | |
return Math.round((value - 255*(1-opacity))/opacity) | |
} | |
export function unblendColor(rgbA, opacity){ | |
return rgbA.map(ch=> unblendColorChanel(ch, opacity)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment