From 8372eb82a448724ed677e9f7af18ef7d5fc6c58d Mon Sep 17 00:00:00 2001 From: Marc Lehmann Date: Thu, 30 Jun 2016 16:59:02 +0000 Subject: [PATCH 06/11] *** empty log message *** --- src/command.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command.C b/src/command.C index c5febcd3..3106bc9b 100644 --- a/src/command.C +++ b/src/command.C @@ -3362,9 +3362,9 @@ rxvt_term::map_rgb24_color (unsigned int r, unsigned int g, unsigned int b) b &= 0xff; unsigned int color = (r << 16) | (g << 8) | b; - unsigned int idx_r = r / (0xff / (Red_levels - 1)); - unsigned int idx_g = g / (0xff / (Green_levels - 1)); - unsigned int idx_b = b / (0xff / (Blue_levels - 1)); + unsigned int idx_r = r * (Red_levels - 1) / 0xff; + unsigned int idx_g = g * (Green_levels - 1) / 0xff; + unsigned int idx_b = b * (Blue_levels - 1) / 0xff; unsigned int idx = colorcube_index (idx_r, idx_g, idx_b); if (rgb24_color[idx] == color) -- 2.13.0