-- lx-bundle:true

-- This file is part of Lx, created by Liqube <www.liqube.com>
-- Copyright Liqube Audio. All rights reserved.
-- Lx Interim License. See LICENSE for details.

--- Selected ANSi preview palette
-- @module plugins.ansipreview.palette

local config = require("core.config")
local PALETTES = require("plugins.ansipreview.palettes")

local settings = config.plugins.ansipreview or {}
local palette_name = settings.palette

if palette_name == nil then
	palette_name = "vga"
end

local palette = type(palette_name) == "string" and PALETTES[palette_name] or nil

if not palette then
	error("config.plugins.ansipreview.palette must name a shipped palette", 0)
end

return palette
