Skip to content

Instantly share code, notes, and snippets.

@dacap
Created December 16, 2020 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacap/dbaaed3597a7a4fa6f07c63a37705a15 to your computer and use it in GitHub Desktop.
Save dacap/dbaaed3597a7a4fa6f07c63a37705a15 to your computer and use it in GitHub Desktop.
Little Aseprite script to swap the opacity value with an alternative value specified in a floating dialog
if opacitydlg then
local toolPref = app.preferences.tool(app.activeTool)
local newValue = opacitydlg.data.opacity
opacitydlg.data = { opacity=toolPref.opacity }
toolPref.opacity = newValue
return
end
local dlg = Dialog{ title="Swap Opacity", onclose=function() opacitydlg=nil end }
dlg:slider{ id="opacity", min=0, max=255, value=app.preferences.tool(app.activeTool).opacity/2 }
dlg:show{ wait=false }
opacitydlg = dlg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment