Named Colors - MOARdV/AvionicsSystems GitHub Wiki

The MAS Named Colors system is 100% compatible with RasterPropMonitor, meaning that a MAS IVA can use the same named colors as an RPM IVA.

Custom colors are declared in config nodes, which may be placed in any .cfg file. A custom color node looks like this:

RPM_GLOBALCOLORSETUP
{
  COLORDEFINITION
  {
    name = MOARdV_IndicatorLampOff
    color = 0, 0, 0, 255
  }
  COLORDEFINITION
  {
    name = MOARdV_IndicatorLampGreen
    color = 0, 255, 58, 255
  }
  ...
}

Each color must contain a name and color field, and each name should be unique. If the same name is found in multiple COLORDEFINITION nodes, the last one MAS encounters will be used. The color field defines the red, green, blue, and alpha channel values, each of which range from 0 to 255.

To use a named color, it must be prefixed with COLOR_ (for example, COLOR_MOARdV_IndicatorLampOff).

Global colors may be overridden in each command pod by adding an RPM_COLOROVERRIDE node to the MASFlightComputer module, as explained in the MASFlightComputer documentation.

Why use Named Colors?

There are two benefits to named colors. First, using a name means that you only have to edit it in one place, instead of hunting through dozens or hundreds of files. Second, for people making customized IVAs, MAS allows each IVA to override named colors. If you're using an existing prop pack, but you want to make changes to some of the colors, you don't have to make copies of all of the props just to change a color. Instead, you use an override in the IVA's config file to edit the named colors in that IVA.

Pre-defined Custom Colors

MAS includes the colors from the XKCD Color Table. These are generated automatically from the KSP game data. They may be accessed using the name COLOR_XKCD_(colorname), such as COLOR_XKCD_SUNYELLOW. Note that spaces ' ' in a name are removed, like in this example.

Squad included some of their own colors in this table, and they may be accessed the same way:

  • COLOR_XKCD_KSPBADASSGREEN: (#b8c971), (184, 201, 113), or (0.72, 0.79, 0.44).
  • COLOR_XKCD_KSPNOTSOGOODORANGE: (#ffb000), (255, 176, 0), or (1.0, 0.69, 0.00).
  • COLOR_XKCD_KSPUIGREY: (#36393d), (54, 57, 61), or (0.21, 0.22, 0.24).
  • COLOR_XKCD_KSPUNNAMEDCYAN: (#5fbdb9), (95, 189, 185), or (0.37, 0.74, 0.73).
  • COLOR_XKCD_KSPNEUTRALUIGREY: (#cac6b7), (202, 198, 183), or (0.79, 0.78, 0.72).