Automatic Train Painter


Automatically colors locomotives and wagons based on their contents.

Tweaks
10 months ago
0.17 - 1.1
78.4K
Trains

FAQ

Color sources:

  • Items and entities: The most representative color for each item is hand-selected from its icon through a semi-automated process.
  • Fluids and barrels: RGB values are pulled directly from each fluid prototype's flow_color (or, sometimes, base_color).
  • Post processing: Because the color shade applied to train and wagon color masks is translucent, each selected item/fluid color is automatically saturated and brightened to keep their in-game appearance truer to their icon/fluid color. Using the extracted color alone would result in a duller appearance. I prefer not to mess with the alpha channel because it cannot be modified through the base game's train GUI. Thus all colors have a default 0.5 alpha value.

Custom colors:

User-added custom colors are now supported on the Map tab of the Mod Settings. Simply copy a table of the following format and paste into the "Input custom colors" setting field:

{
['item1']={r=000,g=000,b=000,a=000},
['item2']={r=255,g=255,b=255,a=255},
}

While there are several checks to prevent improper inputs from crashing the game, edge cases may exist. Please ensure the table conforms to the following rules:

  • {Curly brackets} must be included at the start and end.
  • Spaces, line breaks, and paragraphs are ignored. A vertically-arranged table like above will paste correctly into the single-line setting field.
  • Each item name comes from the object's internal name. These can be found on the Factorio wiki, or in a mod's prototype and locale files. They must contain only alphanumeric characters, "-" or "_", and must be enclosed in both 'single quotes' and [square brackets].
  • Each row must have values for all of r, g, b, and a, each separated by commas, and be wholly enclosed within another set of curly brackets, followed by a comma.
  • "r", "g", "b", and "a" values must be between 0 and 255, inclusive. Please avoid using decimal values from 0 to 1; they will return a black color.
  • Note: there is no practical limit to the number of rows that can be added.

Custom colors also have several ways to be enabled:

  • Off. The default, this ignores any custom colors and instead uses the hardcoded color database to paint trains.
  • Priority. This will use custom colors instead of hardcoded colors of the same item name when painting.
  • Only. Hardcoded colors are ignored; only items included in the custom colors setting will be painted.

Mod support:

Supported mods are currently limited to the following list. Each mod, unless otherwise noted, has a color assigned to every new item, entity, and fluid within. As of version 1.2.0, there are 8673 items and 862 fluids supported with almost 5000 unique colors. If you notice some mod items are missing or icons have changed, please post to the discussion board and I'll update as needed.

Mods with new assets, as of version 1.2.0:

Mods with expanded painting features:

Mods with exemptions from painting: