COLOR RENDER BUG

I've set up my colors for DAY and NIGHT. Using selections from the 16 (actually 14) color palette. Here are the DAYTIME colors. They render nicely on all devices. I just tried it on the black & white EDGE 130. It only supports a WHITE background, so, therefore, my DAYTIME colors are used. As expected, it renders all colors as BLACK. Except, for some reason, it renders PURPLE as WHITE! Clearly a bug.

Top Replies

All Replies

  • -

    Two quick notes.

    1. You don't have to mention me to get the attention of Garmin. Just post your issue. There are at least 4 of us who read the forums and file bugs/tasks/feature requests for the issues presented.
    2. If you think you've found a bug, post it in the ConnectIQ Bug Reports forum area.

    Now, on to the meat of the discussion.

    The palettized color system will select the nearest color in the device color palette to the given color. In this case the device colors are black (0x000000) and white (0xFFFFFF). For the color purlple (0xAA00FF), the distance to black is:

    var black_r = 0x00; /*   0 */ // red component
    var black_g = 0x00; /*   0 */ // green component
    var black_b = 0x00; /*   0 */ // blue component
    
    var purple_r = 0xAA; /* 170 */
    var purple_g = 0x00; /*   0 */
    var purple_b = 0xFF; /* 255 */
    
    var distance_squared = (purple_r - black_r) * (purple_r - black_r) +
                           (purple_g - black_g) * (purple_g - black_g) +
                           (purple_b - black_b) * (purple_b - black_b);
                           
    // (170 - 0) * (170 - 0) +
    // (  0 - 0) * (  0 - 0) +
    // (255 - 0) * (255 - 0)
    
    // (170) * (170) +
    // (  0) * (  0) +
    // (255) * (255)
    
    // 28900
    // 0
    // 65025
    
    // 93925

    and the distance to white is:

    var white_r = 0xFF; /* 255 */ // red component
    var white_g = 0xFF; /* 255 */ // green component
    var white_b = 0xFF; /* 255 */ // blue component
    
    var purple_r = 0xAA; /* 170 */
    var purple_g = 0x00; /*   0 */
    var purple_b = 0xFF; /* 255 */
    
    var distance_squared = (purple_r - white_r) * (purple_r - white_r) +
                           (purple_g - white_g) * (purple_g - white_g) +
                           (purple_b - white_b) * (purple_b - white_b);
                           
    // (170 - 255) * (170 - 255) +
    // (  0 - 255) * (  0 - 255) +
    // (255 - 255) * (255 - 255)
    
    // ( -85) * ( -85) +
    // (-255) * (-255) +
    // (   0) * (   0)
    
    // 7225 +
    // 65025 +
    // 0
    
    // 72250

    The distance from purple to white (72250) is less than the distance from purple to black (93925), so the system chooses to use white.

  • Got it! It makes sense and will do.

    Still, consider on a Black and White display, that if you send any color other than the background, it should probably be rendered in a visible fashion. But I get it if you want to make half the possible color values invisible, I guess.