mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-07 09:13:02 +00:00
color_diff function
This commit is contained in:
@@ -915,6 +915,13 @@ EX color_t colormix(color_t a, color_t b, color_t c) {
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* color difference for 24-bit colors, from 0 to 255*3 */
|
||||||
|
EX int color_diff(color_t a, color_t b) {
|
||||||
|
int res = 0;
|
||||||
|
for(int i=0; i<3; i++) res += abs(part(a, i) - part(b, i));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
EX int rhypot(int a, int b) { return (int) sqrt(a*a - b*b); }
|
EX int rhypot(int a, int b) { return (int) sqrt(a*a - b*b); }
|
||||||
|
|
||||||
EX ld realradius() {
|
EX ld realradius() {
|
||||||
|
|||||||
Reference in New Issue
Block a user