[MOD 0.16] Useful Map Colors

Topics and discussion about specific mods
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

[MOD 0.16] Useful Map Colors

Post by Taehl »

Hello, everyone. I've updated my mod to work with the latest version of the game. :) You can get it on the mod portal: Useful Map Colors

This cosmetic mod changes the colors of resources and constructions on the minimap to a consistent scheme which makes it easy to identify everything. Electricity-related things are yellow; oil/chemical stuff are dark purples; turrets are bright green; assemblers, belts, and inserters are colored appropriately; electric miners are sea-green; furnaces are orange; roboports are violet; beacons are magenta; oil wells are very dark red; pumpjacks are dark green; science labs are light blue; and so forth. Chests are very light-colored to improve their visibility.
Images
I've just about run out of colors to use, but I'm open to suggestions. :)
Last edited by Taehl on Thu Aug 09, 2018 8:54 pm, edited 3 times in total.
Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Jupiter »

Taehl wrote:Electricity-related things are yellow; oil/chemical stuff are dark purples; turrets are bright green; assemblers, belts, and inserters are colored appropriately; electric miners are sea-green; furnaces are orange; roboports are violet; beacons are magenta; oil wells are very dark red; pumpjacks are dark green; science labs are light blue;
And roses are red and I love you.

For this mod :D
Talguy
Fast Inserter
Fast Inserter
Posts: 105
Joined: Tue Apr 29, 2014 8:54 pm
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Talguy »

When are you releasing a 0.14 version?
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Taehl »

I'm going to release a 0.14 version when either A) 0.14 becomes the stable version, or B) Factorio allows mods to work with more than one version. If you need it now, you can extract the mod and edit info.json, changing 0.13 to 0.14. But if you use 0.14, then most mods on the portal will be disabled. :(

Maintaining more than one copy of the same mod would be pretty awful, and would clutter the portal.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Nexela »

That was a bug in .13.18 that has since been fixed

As long as your mod Portal page has a .14 and .13 version of the mod factorio will pick the correct one (unless someone is still using .13.18 for some unknown reason)
Pe334
Inserter
Inserter
Posts: 44
Joined: Thu Jun 16, 2016 4:00 pm
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Pe334 »

Short question, did this mod support bob's-mod belts?

Thx ...
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Taehl »

Currently, I've only hard-coded support for two modded items: Wooden floors and big wooden powerpole. I have yet to figure out a good way for mod items to get correct custom colors, but I'm open to suggestions.
User avatar
Ghoulish
Filter Inserter
Filter Inserter
Posts: 468
Joined: Fri Oct 16, 2015 8:40 am

Re: [MOD 0.13.x+] Useful Map Colors

Post by Ghoulish »

Everything is so much cleaner and more unified with your colour scheme. Something similar should be in vanilla :)

I added this mod a day or so into a new factory, is there a way to force recolouring of items laid before this mods was added?

Thanks for the mod too! ;)

EDIT FOR REFERANCE:

/c game.forces.player.rechart()
See the daily™ struggles with my Factory! :D https://www.twitch.tv/repetitivebeats
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Taehl »

When the new version is out (soon), you won't have to use that command to update your map - it automatically does it for you. 8-)

It also has a config file to let you specify colors for new stuff.
Hazelninja24
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 29, 2016 10:26 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Hazelninja24 »

Hey Taehl, I'm trying to edit the colour of Oil because the black is a bit hard to find on the map I'm on. How would I go about setting this back to magenta (or change it to an equivalent colour)? I have no experience in the code used but thought I would try the style used in your config.lua and data-final-fixes.lua (both by changing the HSL values in dat.resource["crude-oil"].map_colour = HSL(0, 1, 0.05, 0.65) in data-final-fixes.lua and by trying to add { "resource", "crude-oil", HSL(.3, 1, .5, part) }, - an attempt at fuschia - in config.lua but both failed, even after manually entering game.forces.player.rechart() ) Any help appreciated!
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Taehl »

Hi there. It can be a bit technical, but please allow me to explain how to specify colors. You should avoid changing anything except config.lua, just to be safe. For simplicity sake, each number should be a decimal between 0 and 1.

By default, Factorio uses RGB color where the first three numbers express color in terms of much red, green, and blue it has. Lower numbers are darker, and maxing all three gives you white. In RGB, magenta would be "full red and blue, no green" or "{ r=1, g=0, b=1 }".

I don't find RGB very convenient, so I also offer the HSL colorspace. Here, the three numbers stand for Hue (where in the color wheel the color is, from red at 0, green at .33, blue at .66, and red again at 1.0), Saturation (from grey at 0 to full vividness at 1), and Lightness (black at 0, white at 1). In this case, magenta would be "exactly between blue and red, full saturation and normal lightness", or "HSL( 5/6, 1, .5 )". You can mess around with a HSL color picker here: http://www.workwithcolor.com/hsl-color-picker-01.htm

The fourth number, which is optional, means Alpha in either case. Alpha is how transparent or opaque a color is, where 0 is completely invisible. Less than half alpha can be hard to see. For consistency with the alpha levels in UMC itself, I've specified levels for "slight", "part", and "full". If you don't specify alpha, it should default to 1.

With all that being said, the code you would want to add to your config.lua is one of these:

Code: Select all

{ "resource", "crude-oil", { r=1, g=0, b=1, a=part } },

Code: Select all

{ "resource", "crude-oil", HSL( 5/6, 1, .5, part) },
One final note: For some reason, Factorio accepts colors both in the range of 0-1 and 0-255. UMC is automatically compatible with both, just in case. If you have a color which is way off for no reason, double-check that none of its numbers are greater than 1 - if it is, Factorio assumes you're using the 0-255 range.
Hazelninja24
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 29, 2016 10:26 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Hazelninja24 »

Taehl wrote:Hi there. It can be a bit technical, but please allow me to explain how to specify colors. You should avoid changing anything except config.lua, just to be safe. For simplicity sake, each number should be a decimal between 0 and 1.

By default, Factorio uses RGB color where the first three numbers express color in terms of much red, green, and blue it has. Lower numbers are darker, and maxing all three gives you white. In RGB, magenta would be "full red and blue, no green" or "{ r=1, g=0, b=1 }".

I don't find RGB very convenient, so I also offer the HSL colorspace. Here, the three numbers stand for Hue (where in the color wheel the color is, from red at 0, green at .33, blue at .66, and red again at 1.0), Saturation (from grey at 0 to full vividness at 1), and Lightness (black at 0, white at 1). In this case, magenta would be "exactly between blue and red, full saturation and normal lightness", or "HSL( 5/6, 1, .5 )". You can mess around with a HSL color picker here: http://www.workwithcolor.com/hsl-color-picker-01.htm

The fourth number, which is optional, means Alpha in either case. Alpha is how transparent or opaque a color is, where 0 is completely invisible. Less than half alpha can be hard to see. For consistency with the alpha levels in UMC itself, I've specified levels for "slight", "part", and "full". If you don't specify alpha, it should default to 1.

With all that being said, the code you would want to add to your config.lua is one of these:

Code: Select all

{ "resource", "crude-oil", { r=1, g=0, b=1, a=part } },

Code: Select all

{ "resource", "crude-oil", HSL( 5/6, 1, .5, part) },
One final note: For some reason, Factorio accepts colors both in the range of 0-1 and 0-255. UMC is automatically compatible with both, just in case. If you have a color which is way off for no reason, double-check that none of its numbers are greater than 1 - if it is, Factorio assumes you're using the 0-255 range.
Thank you for taking the time to explain this to me! I'm a beginner to code so being able to learn how this works has been a great help. I wasn't even aware that HSL was a thing before giving this a go and I really appreciate that you wrote the particular line I needed. (I'm gonna be honest, I'm too sure how to say thank you without it feeling a little weird for some reason, I'm just really grateful and appreciative)

EDIT: I've just tried putting that code into the config.lua within the mod .zip itself and it doesn't seem to be changing? I've tried the change with a new map but it was still black. I've tried making sure that the only version of Factorio running was the one with the edited code but it just doesn't seem to like it. I'm happy to resign this unless there's anything else that may be causing this?
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Taehl »

Double-check that the mod is enabled. It should automatically redraw the map when you load a game, but the redraw can be a little slow and may need a few minutes to finish (especially in big games). If you load and open your map, you should see explored sectors lighting up one at a time, with the area around the player the last part to redraw.

The end of your config.lua should look similar to this:

Code: Select all

return {
	{ "electric-pole", "big-wooden-pole", HSL(.1, 1.0, .8, part) },
	{ "tile", "wood-floor", HSL(.1, .5, .3, full) },
	{ "resource", "crude-oil", HSL( 5/6, 1, .5, part) },
}
Looking carefully, I think I see what may be causing an issue. Entities in Factorio have both map_color and friendly_map_color, but I think resources may ignore the latter. I've released a small update, let me know if it works for you.
onebit
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Mon Feb 02, 2015 4:32 pm
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by onebit »

The colors are really nice, but it's hard to see new oil deposits.
User avatar
Durabys
Fast Inserter
Fast Inserter
Posts: 236
Joined: Mon Apr 18, 2016 3:30 pm
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Durabys »

So..
..how is this mod any different to this one?

[MOD 0.12.x] Enhanced Map Colors
viewtopic.php?f=144&t=22953
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by Taehl »

That mod has more support for coloring items from other mods out-of-the-box. It was also the inspiration for UMC - I loved the idea, but wanted to improve everything. Mine is more aesthetically pleasing, more informative, and lets you override colors / add your own mod support.

If oil needs better visibility, maybe I'll try changing it again. Instead of a super-dark red, perhaps a dark purple?
onebit
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Mon Feb 02, 2015 4:32 pm
Contact:

Re: [MOD 0.13.x+] Useful Map Colors

Post by onebit »

Maybe the original magenta? rgb(255,0,255). It fits the purple theme for oil.

I feel like it should stand it since it's valuable.
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.16] Useful Map Colors

Post by Taehl »

I finally got around to updating this thing, lol. It has colors for all the new stuff, as well as a few in-game options. For example, you can toggle between Oil Wells being high-visibility purple or the old realistic color. I hope you all enjoy it as much as I've enjoyed making it. :)
slyper52
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Aug 09, 2018 8:59 pm
Contact:

Re: [MOD 0.16] Useful Map Colors

Post by slyper52 »

My map is mostly desert which makes it hard for me to quickly identify my rail system. I tried to modify the config file which now looks like this

-- You can choose your own colors here, for example to add color to other mods' items.
-- Colors can be expressed in standard Factorio Red-Green-Blue table format, or in Hue-Saturation-Lightness.
return {
{ "electric-pole", "big-wooden-pole", HSL(.1, 1.0, .8, part) },
{ "tile", "wood-floor", HSL(.1, .5, .3, full) },
{ "straight-rail", "straight-rail", { r= .8, g= .43, b= .8, a=slight} },
{ "curved-rail", "curved-rail", { r= .8, g= .43, b= .8, a=slight} },

The goal was to make the rails a dark green color but it does't seam to work at all. They are still the same light gray color. any help??
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: [MOD 0.16] Useful Map Colors

Post by Taehl »

If it's exactly like that, you're missing a closing curly bracket at the end:

Code: Select all

return {
	{ "electric-pole", "big-wooden-pole", HSL(.1, 1.0, .8, part) },
	{ "tile", "wood-floor", HSL(.1, .5, .3, full) },
	{ "straight-rail", "straight-rail", { r= .8, g= .43, b= .8, a=slight} },
	{ "curved-rail", "curved-rail", { r= .8, g= .43, b= .8, a=slight} },
}
Missing curly bracket would make loading config.lua fail. When that happens, I have Useful Map Colors throw an error message in the log, but I didn't make it a game-stopping error. Maybe I should, to make it more visible?


Also, the color you describe consists mostly of red and blue - ie., it's more of a light magenta than green. Dark green would be more like:

Code: Select all

{r=0, g=0.5, b=0, alpha=slight}
Finally... I discovered that rails never get recolored at all. :shock: They seem to ignore both map_color AND friendly_map_color! This might be a bug in Factorio?

EDIT) It's not a bug in Factorio, merely a feature. I just released an update - now you can recolor rails!
Post Reply

Return to “Mods”