]> git.mdlowis.com Git - proto/labwc.git/commitdiff
tools/hex: print mean #rrggbb value
authorJohan Malm <jgm323@gmail.com>
Fri, 21 Aug 2020 19:35:42 +0000 (20:35 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 21 Aug 2020 19:35:42 +0000 (20:35 +0100)
tools/hex/hex-color-average.c

index f61504044ef2cae5b869ae8287a6c2ebe4e0fc0a..28877f680873e7845e8d7551c269949bfe27b519 100644 (file)
@@ -54,5 +54,9 @@ int main(int argc, char **argv)
               (col[0] + col[3]) / 2.0,
               (col[1] + col[4]) / 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));
 }