RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility
Livery Editor - CameraLivery Editor - ControlsLivery Editor - Edit ModeLivery Editor – Editor (Core)Livery Editor – HistoryLivery Editor – Layer ActionLivery Editor – Layer EditLivery Editor – LayersLivery Editor – ResourcesLivery Editor – SelectionLivery Editor – ToolsLivery Editor – User DataLivery Editor – Utils
Livery Editor – Layers / CursorLivery Editor – Layers / DecalLivery Editor – Layers / DecalsLivery Editor – Layers / FillLivery Editor – Layers / Group

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionsuiliveryEditorlayers

Livery Editor – Layers / Fill

Manages fill layers - solid colour backgrounds that serve as the base coat in a livery.

Manages fill layers - solid colour backgrounds that serve as the base coat in a livery.


Overview

ui_liveryEditor_layers_fill handles creation, colour editing, saving/restoring, and data requests for fill layers. Fill layers use a colorPaletteMapId system where 0 means custom colour and non-zero means the vehicle's default paint.

Extension path: lua/ge/extensions/ui/liveryEditor/layers/fill.lua


Exports (M)

FunctionSignatureDescription
setLayer(layerUid)Sets the active fill layer UID and caches a deep copy.
changeColor(color)Changes the fill colour. Accepts RGB (3) or RGBA (4) arrays. Sets colorPaletteMapId to 0.
addLayer(params) → layerAdds a new fill layer. If params.color is given, uses custom colour.
updateLayer(params)Updates the active layer's colour.
saveChanges()Commits current state by re-caching the layer data.
restoreLayer()Restores the layer to its last saved/cached state.
restoreDefault()Resets colorPaletteMapId to 1 (vehicle default paint).
requestLayerData()Sends fill layer data to the UI via liveryEditor_fill_layerData.

Internals

Color Palette Map ID

  • 0 - custom colour (user-editable)
  • 1+ - vehicle default paint colour (read from getPlayerVehicle(0).color)

When adding a new fill layer with colorPaletteMapId == 0, the module sets the initial colour to the current vehicle paint colour.

changeColor

M.changeColor = function(color)
  local layer = api.getLayerByUid(M.layerUid)
  if layer.colorPaletteMapId ~= 0 then
    layer.colorPaletteMapId = 0  -- switch to custom
  end
  layer.color = Point4F.fromTable(color)
  api.setLayer(layer, true)
end

How It Works

  1. addLayer({color = vehicleObj.color}) creates the base fill with the car's paint
  2. changeColor({r, g, b}) sets a custom colour, overriding the palette
  3. restoreDefault() reverts to palette ID 1 (vehicle paint)
  4. requestLayerData() sends the current colour to the UI for the colour picker

Example Usage

local fill = extensions.ui_liveryEditor_layers_fill

-- Add a white fill layer
local layer = fill.addLayer({ color = {1, 1, 1, 1} })

-- Change to red
fill.setLayer(layer.uid)
fill.changeColor({1, 0, 0, 1})

-- Restore to vehicle default
fill.restoreDefault()

Additional Exports

The following exports are available but not yet documented in detail:

  • M.addLayer
  • M.layerData
  • M.requestLayerData
  • M.restoreDefault
  • M.restoreLayer
  • M.saveChanges
  • M.setLayer
  • M.updateLayer

Livery Editor – Layers / Decals

Operates on existing decal layers - transform (scale, skew, rotate), material properties (colour, metallic, roughness), and data formatting.

Livery Editor – Layers / Group

Provides operations on linked-set (group) layers - material propagation to child layers.

On this page

OverviewExports (M)InternalsColor Palette Map IDchangeColorHow It WorksExample UsageAdditional Exports