** UPDATE: v2.0 - 5/12/21 ** - Get button now stores both foreground and background color - Added background choice to base color picker - User can now click to switch between generated base color palettes - Fixed dialogue window resizing bug
I recently made the switch from PyxelEdit to Aseprite, and while Iām loving it, I really miss the shading color options that PE had.
So I wrote a script that recreates the feature. Hope others find it helpful! If anyone can think of improvements let me know
Download the file from GitHub or copy/paste the raw text into a new Lua file
Open Aseprite, go to File ā Scripts ā Open Scripts Folder (Keep this open)
Place the Downloaded file above into the Scripts Folder
Restart Aseprite. āColor Shadingā can now be accessed in the Scripts menu
Commands:
ā āGetā Button: Updates base colors using the current foreground and background color and regenerates the shading palette.
ā Left click: Set clicked color as foreground color.
ā Right click: Set clicked color as background color.
ā Middle click: Set clicked color as foreground color and regenerate shades based on this new color.
ā Base: Clicking on either base color will switch the shading palette to that saved color
Hi @domjohn! Thanks for creating this, it was always on my mind to create this feature as a script, but Iāve delayed both: the feature itself and the script API to enable a proper implementation of custom color pickers.
I think that this is a good candidate to start #1949. Iāll write down the list of features we need:
Support observing some app events like āforeground color changeā (or maybe observing preference changes in general, e.g. app.preferences.color_bar.fg_color is accessible through scripts right now).
We should be able to know if the color was set by the user or by the script itself
New widget to show a set of colors like the color bar
A way to update color values while the dialog is open (all widgets should be modifiable when the dialog is open, but it was not implemented on these early stages yet)
Support extensions with scripts? For this particular feature itās not required because the dialog can be triggered from the File > Scripts and we could start observing the āforeground color changeā event only when the dialog is open
Very awesome! So happy this could be of some help. Those listed features would be perfect to improve user experience. If thereās any possible way I can be of assistance or testing please donāt hesitate to ask
Thanks for all the hard work youāve put into this program, and the active support and passion you have for the project. This community sees it all and really appreciates it!
I canāt seem to get the script working. I get this error :
[string "internal"]:1: stack trackback:
[string "internal"]:1: in function '__generic_mt_index'
C:\Users\A\AppData\Roaming\Aseprite\Script\Color Shading.lua:127 in function 'showColors'
C:\Users\A\AppData\Roaming\Aseprite\Script\Color Shading.lua:152: in main Chunks: Field shades does not exist
Hmm. It looks like maybe some extra letters/symbols got copied over into your file. Iām using macOS as well, and not getting that line ā<ā symbol on line 7 error.
@domjohn Great Script, do you permit me to use your code? I am working on a script project for Surface Go PC\Tablet users. I will write your name in the Special thank section.
This is script is so useful, thanks again.
Iām trying to add a little feature to this script. Iād like every RGB output to be multiples of 8.
So the little swatches of color of the shading/lightness/saturation/hue would be colors composed of multiples of 8 (8 16 32 40ā¦).
Script has been updated so that right clicks will set background color on the main Aseprite palette. Also added a middle click to regenerate the shading palette based on whatever is clicked.
Or, copy/paste from that raw link instead. Sometimes bringing things over from code view on GitHub can have weird effects and bring in extra/missing text.