RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Ambient SoundUI Apps ManagerUI AudioBindings LegendCamera Distance AppDeveloper ConsoleCredits MusicExternal WebSocket ServerFade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsNavigation Map DataVehicle Paint EditorVehicle Vicinity AppUI Visibility
Camera ManagementAction Map ManagementEdit Mode State MachineLivery EditorUndo/Redo WrapperLayer ActionsLayer Edit LifecycleLayer DataDecal Texture LoaderLayer SelectionToolsLivery FilesMath Utilities
Decal CursorDecal OperationsDecal LayersFill LayersGroup Layers

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

Fill Layers

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

See Also

  • Livery Editor – Layers / Cursor - Related reference
  • Livery Editor – Layers / Decal - Related reference
  • Livery Editor – Layers / Decals - Related reference
  • UI System Guide - Guide

Decal Layers

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

Group Layers

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

On this page

OverviewExports (M)InternalsColor Palette Map IDchangeColorHow It WorksExample UsageAdditional ExportsSee Also