How to swap 2 colors in the palette

hello. i dont find how to swap 2 colors in the palette ?


i don’t think there’s such a function.
but a little script like this should do the trick:

local palette = app.activeSprite.palettes[1]
local selectedColors = app.range.colors
local color1 = palette:getColor(selectedColors[1])
local color2 = palette:getColor(selectedColors[2])
palette:setColor(selectedColors[1], color2)
palette:setColor(selectedColors[2], color1)

this will, of course, work only for two selected swatches

1 Like

sorry, this do nothing…

weird, it does work for me. you got to have two colours selected in palette (or at least one). i’m on v1.3 beta, not sure if that makes a difference. also sometimes scripts don’t work properly when copy pasted from the site.

ok solved, it works ! thanks

1 Like