News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Minimap scale colours: bug, fix, and query

Started by jamespetts, December 30, 2014, 01:05:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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:

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:


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:


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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

Ters

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.

jamespetts

#3
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:


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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.