News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Network line colors

Started by prissi, April 06, 2015, 09:56:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prissi

Go ahead, I am really open to improvements. I just fear that everyone has a different tast (and monitor) and hence would consider something different better.

yorkeiser

First of all hi prissi, nice to hear again from you (that's my fault, have had little time to join the forum due to life happenings).
When we talked about and then developed net graphs this question already arose: often colors assigned to lines avoid lines to be distinguishable, cause of colors being too similar sometimes for near lines. I can't tell you what's the solution cause I don't remember the code; based on my rememberings, minimap colors are just 256, so it's not easy to give player a wide color variety. I also don't remember if minimap palette colors are already use for other things (icons, map...), but i really suspect they are.
The basic idea would be to:
1) assign to the line a color that isn't used by a near line
2) In addiction, line colors would have to be contrasting on the map (0xFF0000 contrasts well, 0x777777 not...) Easy to tell, I know, I also remember difficulties when worked on that.

Thinking about a solution...
1) every line could be assigned a "geographical" coefficient (x,y), e.g. calculated as the average of its stations' (x,y) coordinates (of course other metrics could give better results). So lines' array could be ordered by this coefficient and given a preassigned color that could guarantee the right distance between lines.
By example a NW line would have low x and y average values, while a NE  line would have low y and hi x values. If the colors array would be really different among adiacent cells, near lines would have different colors on minimap.

E.g.
Line NW1 - minimum (x,y) coefficient -> becomes line[0] and is assigned color[0]=0xFF0000
Line NW2 - line[1] - color[1]=0x00FF00
Line NW3 - line[2] - color[2]=0x0000FF
Line NW4 - line[3] - color[3]=0x... (adiacent colors are really different)

I hope you understood me, my english often has some lacks :)

prissi

After recent renovation of the drawing system RGB colors can be used, since the lines are drawn as an overlay and could use "display_direct_line_rgb". Even though if the minimap is still 240 colors.