The International Simutrans Forum

 

Author Topic: Minimap scale colours: bug, fix, and query  (Read 1990 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Minimap scale colours: bug, fix, and query
« on: December 30, 2014, 01:05:53 AM »
The minimap window's "show scale" function has a small bug, in that the lowest scale colour will repeat twice and the highest scale colour will not be shown. Below is a fix:

Code: [Select]
for(  int i=0;  i<MAX_SEVERITY_COLORS;  i++  ) {
-            display_fillbox_wh(bar_pos.x + min_label.get_size().w + D_H_SPACE + (i*bar_width), bar_pos.y+2,  bar_width+1, 7, reliefkarte_t::calc_severity_color(i,MAX_SEVERITY_COLORS), false);
+            display_fillbox_wh(bar_pos.x + min_label.get_size().w + D_H_SPACE + (i*bar_width), bar_pos.y+2,  bar_width+1, 7, reliefkarte_t::calc_severity_color(i+1,MAX_SEVERITY_COLORS), false);
         }

Incidentally, the colours chosen for the scale are a little unusual. They are:

Code: [Select]
const uint8 reliefkarte_t::severity_color[MAX_SEVERITY_COLORS] =
{
    106, 2, 85, 86, 29, 30, 171, 71, 39, 132
};

This produces a dark greyish purple as the lowest scale colour, progressing to blue and green in the middle and red at the top. Is there a reason that it was done this way, rather than using green, yellow, orange, red as is more usual with such things? How about the following:

Code: [Select]
const uint8 reliefkarte_t::severity_color[MAX_SEVERITY_COLORS] =
{
    COL_DARK_GREEN, COL_GREEN, COL_LIGHT_GREEN, COL_LIGHT_YELLOW, COL_YELLOW, 30, COL_LIGHT_ORANGE, COL_ORANGE, COL_DARK_ORANGE, COL_RED
};

The one thing in relation to that is that COL_LIGHT_GREEN is rather close to COL_GREEN: it could do with being a lighter, more yellowish green. Does anyone happen to know the correct colour number for a light, yellowish green?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4601
  • Languages: EN, DE, AT
Re: Minimap scale colours: bug, fix, and query
« Reply #1 on: December 30, 2014, 08:38:25 AM »
The off-by-one error is fixed in r7441. thank you for spotting this.

To be honest, I like the original coloring of the legend more than your proposed one.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Minimap scale colours: bug, fix, and query
« Reply #2 on: December 30, 2014, 09:32:29 AM »
Using the entire spectrum probably makes it easier to see the differences. From an accessability standpoint, using red and green together is actually a bad idea.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Minimap scale colours: bug, fix, and query
« Reply #3 on: December 30, 2014, 09:56:36 AM »
There was a user on this forum who had a pantropia chart in his signature at one point: I think that it was SDog. I wonder whether he could comment?

Edit: A more rainbow like alternative might be:

Code: [Select]
73, 2, 85, 86, 171, 30, 29, 71, 39, 132

The purple colour here is not quite as dark or grey as the original, and the yellows are re-ordered so that the darker yellows are consistently higher moving toward the orange and red, which makes more sense to me than the current arrangement where one starts with dark yellow, moves to light yellow, then back to orange again.
« Last Edit: December 30, 2014, 10:07:54 AM by jamespetts »