[Script] More Color Shading Options!

** 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 :slight_smile:

Download Link
Github - Aseprite Color Shading

Installation:

  1. Download the file from GitHub or copy/paste the raw text into a new Lua file
  2. Open Aseprite, go to File → Scripts → Open Scripts Folder (Keep this open)
  3. Place the Downloaded file above into the Scripts Folder
  4. 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

24 Likes

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:

  1. 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).
  2. We should be able to know if the color was set by the user or by the script itself
  3. New widget to show a set of colors like the color bar
  4. 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)
  5. 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
6 Likes

This is so nice, domjohn, thank you very much for creating and sharing it! :smiley:

I’ve added this script to the list of scripts I’m collecting here, I hope you don’t mind.

3 Likes

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 :grinning:

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!

5 Likes

No problem JJ, I’m so glad it’s useful! Of course, feel free to add it anywhere you think would help out.

4 Likes

Hi,

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

Am I doing something wrong?

1 Like

@Arkogelul the script above was recently updated for Aseprite v1.2.17 (coming soon), some features aren’t quite available yet.

Try this older one in the meantime:

1 Like

Thank you! :slight_smile:

Hi @domjohn, Thanks for the great contribution
could you please update the script for version v1.2.18
Thank you so much :slight_smile:

Happy it helps!! The latest version of the script should be working properly in 1.2.18.

Let me know if you are having troubles or think it’s missing certain new features! :slight_smile:

when I try to open the script I get this message

:frowning:

1 Like

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.

I would delete it from the Aesprite scripts folder, and then try using the raw download link to grab the .lua file again: https://raw.githubusercontent.com/dominickjohn/aseprite/master/Color%20Shading.lua

You could also try manually copy/pasting the code from the link above. If you still have troubles let me know!

3 Likes

Maybe your script was suffering from jpeg artifacting. Always export to png! :wink:

1 Like

@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…).

wow, i choose Pyxel edit over aseprite only for this feature. Love it, back to Aseprite now :slight_smile:

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.

Hope this helps speed things up! :slight_smile:

1 Like

Thank you so mucho for this script! I was missing this feature from pyxel edit, now I feel at home in Aseprite.

1 Like

So i got this problem…

Try downloading the file in raw form here: https://raw.githubusercontent.com/dominickjohn/aseprite/master/Color%20Shading.lua

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.

1 Like