tools/hex: print mean #rrggbb value

This commit is contained in:
Johan Malm 2020-08-21 20:35:42 +01:00
parent 83331e57ed
commit 9d408aad73

View file

@ -54,5 +54,9 @@ int main(int argc, char **argv)
(col[0] + col[3]) / 2.0, (col[0] + col[3]) / 2.0,
(col[1] + col[4]) / 2.0, (col[1] + col[4]) / 2.0,
(col[2] + col[5]) / 2.0); (col[2] + col[5]) / 2.0);
printf("[ mean ] #%x%x%x\n",
(int)((col[0] + col[3]) / 2.0 * 255),
(int)((col[1] + col[4]) / 2.0 * 255),
(int)((col[2] + col[5]) / 2.0 * 255));
} }