Created
March 13, 2018 02:07
-
-
Save luctrudeau/efb7ce02baecf91e06dbd6ebaffca627 to your computer and use it in GitHub Desktop.
HiColorAverage
This file contains hidden or 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
uint16_t hicolor_avg(uint16_t a, uint16_t b) { | |
const uint16_t s = a ^ b; | |
return ((s & 0xF7DEU) >> 1) + (a & b) + (s & 0x0821U); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment