class ColorMixin(name: str, similar_entities: list[str], **kwargs: dict)

Gives the entity an editable color.

property color: dict

The color of the Entity.

The color attribute exists in a dict format with the “r”, “g”, “b”, and an optional “a” keys. The color can be specified like that, or it can be specified more succinctly as a sequence of 3-4 numbers, representing the colors in that order.

The value of each of the numbers (according to Factorio spec) can be either in the range of [0.0, 1.0] or [0, 255]; if all the numbers are <= 1.0, the former range is used, and the latter otherwise. If “a” is omitted, it defaults to 1.0 or 255 when imported, depending on the range of the other numbers.


Gets the color of the Entity, or None if not set.


Sets the color of the Entity.


dict{"r": float, "g": float, "b": float, Optional("a"): float}


DataFormatError – If the set color does not match the above specification.