Skip to content

Instantly share code, notes, and snippets.

@gpprojekt-marcin
Created February 26, 2020 08:40
Show Gist options
  • Save gpprojekt-marcin/03c590888d6950c185086a6d930f2ff1 to your computer and use it in GitHub Desktop.
Save gpprojekt-marcin/03c590888d6950c185086a6d930f2ff1 to your computer and use it in GitHub Desktop.
Color unBlender/unMixer
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