Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Runtime Docs Version 2.0.77

# Color - Runtime Docs

## Color :: table or {float, float, float, float}

Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. All values here are optional. Color channels default to `0`, the alpha channel defaults to `1`.

Similar to MapPosition, Color allows the short-hand notation of passing an array of exactly 3 or 4 numbers. The game usually expects colors to be in pre-multiplied form (color channels are pre-multiplied by alpha).

#### Table fields

r | :: float? |
g | :: float? |
b | :: float? |
a | :: float? |

#### Example

    red1 = {r = 0.5, g = 0, b = 0, a = 0.5}  -- Half-opacity red
    red2 = {r = 0.5, a = 0.5}                -- Same color as red1
    black = {}                               -- All channels omitted: black
    red1_short = {0.5, 0, 0, 0.5}            -- Same color as red1 in short-hand notation

Concept used in

- LuaAirbornePollutantPrototype::chart_color
- LuaBurnerPrototype::light_flicker
- LuaEntity::color
- LuaEntityPrototype::map_color
- LuaEntityPrototype::friendly_map_color
- LuaEntityPrototype::enemy_map_color
- LuaEntityPrototype::color
- LuaEntityPrototype::damage_hit_tint
- LuaEntityPrototype::arm_color_gradient
- LuaEquipmentPrototype::background_color
- LuaFluidPrototype::base_color
- LuaFluidPrototype::flow_color
- LuaFluidPrototype::visualization_color
- LuaFontPrototype::border_color
- LuaForce::custom_color
- LuaForce::color
- LuaItemCommon::label_color
- LuaItemCommon::entity_color
- LuaItemPrototype::get_selection_border_color()
- LuaItemPrototype::fuel_glow_color
- LuaItemPrototype::radius_color
- LuaItemPrototype::default_label_color
- LuaItemPrototype::beacon_tint
- LuaLampControlBehavior::color
- LuaModSettingPrototype::default_value
- LuaPlayer::create_local_flying_text()
- LuaPlayer::color
- LuaPlayer::chat_color
- LuaQualityPrototype::color
- LuaRecipePrototype::crafting_machine_tints
- LuaRenderObject::color
- LuaRendering::draw_line()
- LuaRendering::draw_text()
- LuaRendering::draw_circle()
- LuaRendering::draw_rectangle()
- LuaRendering::draw_arc()
- LuaRendering::draw_polygon()
- LuaRendering::draw_sprite()
- LuaRendering::draw_light()
- LuaRendering::draw_animation()
- LuaStyle::font_color
- LuaStyle::hovered_font_color
- LuaStyle::clicked_font_color
- LuaStyle::disabled_font_color
- LuaStyle::pie_progress_color
- LuaStyle::selected_font_color
- LuaStyle::selected_hovered_font_color
- LuaStyle::selected_clicked_font_color
- LuaStyle::strikethrough_color
- LuaStyle::color
- LuaStyle::default_badge_font_color
- LuaStyle::selected_badge_font_color
- LuaStyle::disabled_badge_font_color
- LuaSurface::create_entity()
- LuaTilePrototype::map_color
- LuaTilePrototype::scorch_mark_color
- LuaTrivialSmokePrototype::color
- BlueprintEntity
- ModSetting
- PrintSettings
- ScriptArea
- ScriptPosition
- TriggerEffectItem