** 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.