\documentclass[10pt,a4paper,twocolumn]{article}%
\usepackage{fouriernc}
\usepackage[svgnames]{xcolor}
\usepackage{luadraw}
\usepackage[margin=1.5cm,headheight=15pt]{geometry}
\title{The \textbf{luadraw\_palette} extension}
\date{}
\begin{document}
\maketitle{}

\begin{verbatim}
local pal = require 'luadraw_palettes'
\end{verbatim}

\begin{luacode*}
local ld = luadraw
local Z = ld.cpx.Z
local pal = require 'luadraw_palettes'

local palNames={["Accent"]=pal.Accent, ["Acton"]=pal.Acton, ["Afmhot"]=pal.Afmhot, ["AgGrnYl"]=pal.AgGrnYl, ["AgSunset"]=pal.AgSunset, ["Algae"]=pal.Algae, ["Alphabet"]=pal.Alphabet, ["Amp"]=pal.Amp, ["Antique"]=pal.Antique, ["Aquatic1"]=pal.Aquatic1, ["Aquatic2"]=pal.Aquatic2, ["Aquatic3"]=pal.Aquatic3, ["ArmyRose"]=pal.ArmyRose, ["Autumn"]=pal.Autumn, ["Bam"]=pal.Bam, ["BamO"]=pal.BamO, ["Bamako"]=pal.Bamako, ["Batlow"]=pal.Batlow, ["BatlowK"]=pal.BatlowK, ["BatlowW"]=pal.BatlowW, ["Berlin"]=pal.Berlin, ["Bilbao"]=pal.Bilbao, ["Binary"]=pal.Binary, ["Blackbody"]=pal.Blackbody, ["BlindFish"]=pal.BlindFish, ["BluGrn"]=pal.BluGrn, ["BluYl"]=pal.BluYl, ["BlueDarkOrange12"]=pal.BlueDarkOrange12, ["BlueDarkOrange18"]=pal.BlueDarkOrange18, ["BlueDarkRed12"]=pal.BlueDarkRed12, ["BlueDarkRed18"]=pal.BlueDarkRed18, ["BlueGray"]=pal.BlueGray, ["BlueGreen"]=pal.BlueGreen, ["BlueOrange10"]=pal.BlueOrange10, ["BlueOrange12"]=pal.BlueOrange12, ["BlueOrange8"]=pal.BlueOrange8, ["BlueOrangeRed"]=pal.BlueOrangeRed, ["BlueRed"]=pal.BlueRed, ["BlueRedPly"]=pal.BlueRedPly, ["Blues"]=pal.Blues, ["Blues10"]=pal.Blues10, ["Blues7"]=pal.Blues7, ["Bold"]=pal.Bold, ["Bone"]=pal.Bone, ["BrBG"]=pal.BrBG, ["Brg"]=pal.Brg, ["Broc"]=pal.Broc, ["BrocO"]=pal.BrocO, ["BrownBlue10"]=pal.BrownBlue10, ["BrownBlue12"]=pal.BrownBlue12, ["BrwnYl"]=pal.BrwnYl, ["BuGn"]=pal.BuGn, ["BuPu"]=pal.BuPu, ["Buda"]=pal.Buda, ["Bukavu"]=pal.Bukavu, ["Burg"]=pal.Burg, ["BurgYl"]=pal.BurgYl, ["BurningGrass"]=pal.BurningGrass, ["Bwr"]=pal.Bwr, ["CMRmap"]=pal.CMRmap, ["Cavalcanti"]=pal.Cavalcanti, ["Chevalier"]=pal.Chevalier, ["Cividis"]=pal.Cividis, ["ColorBlind"]=pal.ColorBlind, ["Cool"]=pal.Cool, ["Coolwarm"]=pal.Coolwarm, ["Copper"]=pal.Copper, ["Cork"]=pal.Cork, ["CorkO"]=pal.CorkO, ["Cube1"]=pal.Cube1, ["CubeYF"]=pal.CubeYF, ["Cubehelix"]=pal.Cubehelix, ["Cubehelix1"]=pal.Cubehelix1, ["Cubehelix2"]=pal.Cubehelix2, ["Cubehelix3"]=pal.Cubehelix3, ["Curl"]=pal.Curl, ["Darjeeling1"]=pal.Darjeeling1, ["Darjeeling2"]=pal.Darjeeling2, ["Darjeeling3"]=pal.Darjeeling3, ["Darjeeling4"]=pal.Darjeeling4, ["Dark2"]=pal.Dark2, ["Dark24"]=pal.Dark24, ["DarkMint"]=pal.DarkMint, ["Davos"]=pal.Davos, ["Deep"]=pal.Deep, ["Delta"]=pal.Delta, ["Dense"]=pal.Dense, ["Devon"]=pal.Devon, ["Earth"]=pal.Earth, ["Electric"]=pal.Electric, ["Emrld"]=pal.Emrld, ["Fall"]=pal.Fall, ["FantasticFox1"]=pal.FantasticFox1, ["FantasticFox2"]=pal.FantasticFox2, ["Fes"]=pal.Fes, ["Flag"]=pal.Flag, ["G10"]=pal.G10, ["GasFlame"]=pal.GasFlame, ["GeoRainbow"]=pal.GeoRainbow, ["Geyser"]=pal.Geyser, ["GistEarth"]=pal.GistEarth, ["GistHeat"]=pal.GistHeat, ["GistNcar"]=pal.GistNcar, ["GistRainbow"]=pal.GistRainbow, ["GistStern"]=pal.GistStern, ["Glasgow"]=pal.Glasgow, ["GnBu"]=pal.GnBu, ["Gnuplot"]=pal.Gnuplot, ["Gnuplot2"]=pal.Gnuplot2, ["GrandBudapest1"]=pal.GrandBudapest1, ["GrandBudapest2"]=pal.GrandBudapest2, ["GrandBudapest3"]=pal.GrandBudapest3, ["GrandBudapest4"]=pal.GrandBudapest4, ["GrandBudapest5"]=pal.GrandBudapest5, ["GrayC"]=pal.GrayC, ["GrayTab"]=pal.GrayTab, ["Grays"]=pal.Grays, ["GreenMagenta"]=pal.GreenMagenta, ["GreenOrange"]=pal.GreenOrange, ["Greens"]=pal.Greens, ["Haline"]=pal.Haline, ["Hawaii"]=pal.Hawaii, ["Hot"]=pal.Hot, ["Hsv"]=pal.Hsv, ["Ice"]=pal.Ice, ["Imola"]=pal.Imola, ["Inferno"]=pal.Inferno, ["IsleOfDogs1"]=pal.IsleOfDogs1, ["IsleOfDogs2"]=pal.IsleOfDogs2, ["IsleOfDogs3"]=pal.IsleOfDogs3, ["Jet"]=pal.Jet, ["JimSpecial"]=pal.JimSpecial, ["Lajolla"]=pal.Lajolla, ["Lapaz"]=pal.Lapaz, ["Lemon"]=pal.Lemon, ["Light24"]=pal.Light24, ["LinearL"]=pal.LinearL, ["Lipari"]=pal.Lipari, ["Lisbon"]=pal.Lisbon, ["Magenta"]=pal.Magenta, ["Magma"]=pal.Magma, ["Managua"]=pal.Managua, ["Margot1"]=pal.Margot1, ["Margot2"]=pal.Margot2, ["Margot3"]=pal.Margot3, ["Matter"]=pal.Matter, ["Mendl"]=pal.Mendl, ["Mint"]=pal.Mint, ["Moonrise1"]=pal.Moonrise1, ["Moonrise2"]=pal.Moonrise2, ["Moonrise3"]=pal.Moonrise3, ["Moonrise4"]=pal.Moonrise4, ["Moonrise5"]=pal.Moonrise5, ["Moonrise6"]=pal.Moonrise6, ["Moonrise7"]=pal.Moonrise7, ["Navia"]=pal.Navia, ["NaviaW"]=pal.NaviaW, ["NipySpectral"]=pal.NipySpectral, ["Nuuk"]=pal.Nuuk, ["Ocean"]=pal.Ocean, ["Oleron"]=pal.Oleron, ["OrRd"]=pal.OrRd, ["OrYel"]=pal.OrYel, ["Oranges"]=pal.Oranges, ["Oslo"]=pal.Oslo, ["Oxy"]=pal.Oxy, ["PRGn"]=pal.PRGn, ["Paired"]=pal.Paired, ["Pastel"]=pal.Pastel, ["Pastel1"]=pal.Pastel1, ["Pastel2"]=pal.Pastel2, ["PastelRainbow"]=pal.PastelRainbow, ["Peach"]=pal.Peach, ["PerceptualRainbow"]=pal.PerceptualRainbow, ["Phase"]=pal.Phase, ["PiYG"]=pal.PiYG, ["Picnic"]=pal.Picnic, ["Pink"]=pal.Pink, ["PinkYl"]=pal.PinkYl, ["Plasma"]=pal.Plasma, ["Plotly"]=pal.Plotly, ["Portland"]=pal.Portland, ["Prism"]=pal.Prism, ["PrismCC"]=pal.PrismCC, ["PuBu"]=pal.PuBu, ["PuBuGn"]=pal.PuBuGn, ["PuOr"]=pal.PuOr, ["PuRd"]=pal.PuRd, ["Purp"]=pal.Purp, ["PurpOr"]=pal.PurpOr, ["Purple"]=pal.Purple, ["PurpleGray"]=pal.PurpleGray, ["Purples"]=pal.Purples, ["Rainbow"]=pal.Rainbow, ["RainbowPly"]=pal.RainbowPly, ["RdBu"]=pal.RdBu, ["RdGy"]=pal.RdGy, ["RdPu"]=pal.RdPu, ["RdYlBu"]=pal.RdYlBu, ["RdYlGn"]=pal.RdYlGn, ["Red"]=pal.Red, ["RedOr"]=pal.RedOr, ["RedYellowBlue"]=pal.RedYellowBlue, ["Reds"]=pal.Reds, ["Roma"]=pal.Roma, ["RomaO"]=pal.RomaO, ["Royal1"]=pal.Royal1, ["Royal2"]=pal.Royal2, ["Royal3"]=pal.Royal3, ["Safe"]=pal.Safe, ["Seismic"]=pal.Seismic, ["Set1"]=pal.Set1, ["Set2"]=pal.Set2, ["Set3"]=pal.Set3, ["ShiftRainbow"]=pal.ShiftRainbow, ["Solar"]=pal.Solar, ["Spectral"]=pal.Spectral, ["Speed"]=pal.Speed, ["Spring"]=pal.Spring, ["Summer"]=pal.Summer, ["Sunset"]=pal.Sunset, ["SunsetDark"]=pal.SunsetDark, ["T10"]=pal.T10, ["Tab10"]=pal.Tab10, ["Tab20"]=pal.Tab20, ["Tab20b"]=pal.Tab20b, ["Tab20c"]=pal.Tab20c, ["Tableau"]=pal.Tableau, ["TableauLight"]=pal.TableauLight, ["TableauMedium"]=pal.TableauMedium, ["TdocBW"]=pal.TdocBW, ["TdocCol"]=pal.TdocCol, ["TdocDark"]=pal.TdocDark, ["Teal"]=pal.Teal, ["TealGrn"]=pal.TealGrn, ["TealRose"]=pal.TealRose, ["Tempo"]=pal.Tempo, ["Temps"]=pal.Temps, ["Terrain"]=pal.Terrain, ["Thermal"]=pal.Thermal, ["Tofino"]=pal.Tofino, ["Tokyo"]=pal.Tokyo, ["TrafficLight"]=pal.TrafficLight, ["Tropic"]=pal.Tropic, ["Turbid"]=pal.Turbid, ["Turbo"]=pal.Turbo, ["Turku"]=pal.Turku, ["Twilight"]=pal.Twilight, ["TwilightShifted"]=pal.TwilightShifted, ["Vanimo"]=pal.Vanimo, ["Vik"]=pal.Vik, ["VikO"]=pal.VikO, ["Viridis"]=pal.Viridis, ["Vivid"]=pal.Vivid, ["Winter"]=pal.Winter, ["Wistia"]=pal.Wistia, ["YlGn"]=pal.YlGn, ["YlGnBu"]=pal.YlGnBu, ["YlOrBr"]=pal.YlOrBr, ["YlOrRd"]=pal.YlOrRd, ["Zissou"]=pal.Zissou}

function ld.Dpalette(pl,name)
    local g = ld.graph:new{window={-5,5,-5,5},bbox=false, border=false}
    g:Linewidth(1)
    local A, h, dh, L, N = Z(-5,4), Z(0,-1), Z(0,-1.1), 5, 100
    local dl = L/N
    for k = 1, N do
        local color = ld.palette(pl,(k-1)/(N-1))
        g:Drectangle(A,A+h,A+h+dl,"color="..color..",fill="..color)
        A = A+dl
    end
    g:Drectangle(A,A+h,A+h-L); g:Dlabel("pal."..name,A+h/2,{pos="E"})
    g:Sendtotex()
    tex.sprint("\\par\\vspace{1mm}")
end

local names = {}
for key,val in pairs(palNames) do -- on extrait les noms
    table.insert(names,key)
end

table.sort(names) -- ordre alphabétique
print("nb colors (version 1.3.0) =", #names)

for _,nom in ipairs(names) do
    ld.Dpalette(palNames[nom],nom)
end
\end{luacode*}


\end{document} 
