[SCRIPT] FastBit color picker v1.2

FastBit


A bit based color picker!

Main Dialog Example

It’s simple to use:

This is the channel depth dialog. It’s where you select your color depth.
Setup Dialog

Merely adjust the sliders for each channel to their desired values.
Setup Example

Then you come to the fun screen. This is where we can edit our colors.
Main Dialog Example
We have the color value sliders, which will snap to the bit depth you previously selected.

Next is the “Lock palette colors” option, which starts selected. When checked, any edits you make to a color will only affect the selected color and not its palette entry. Much like how the lock symbol works in Aseprite’s native palette window. If you want to edit a palette color, uncheck this box, then select that color in either the foreground or background color.

Then we have the “Get FG Color” and “Get BG Color” buttons. They do exactly what they say, and once selected, FastBit will edit that color in the native color window.

Here we’ll uncheck the “Lock palette colors” option and select the foreground color.
Select FG

Then we’ll adjust the sliders to change the color.
Edit FG

We have now edited our foreground color, and if that color was selected from the palette first, its palette entry would be edited, too, as we had unlocked the palette.

Simple, right?

I hope this helps some people as much as it has helped me.

Where do I get it?
On GitHub, here.

Just click download, unzip it, and drop it into your scripts folder.


Q: Why did my swatch disappear? It now says “No color.”
A: It’s a quirk of Aseprite. In ‘sort mode’ you can rearrange swatches, as well as drag them away to clear them. Merely re-get your color with the appropriate buttons, or adjust the slider. Fast bit will update the swatch.

Q: Why are my edits not modifying my palette colors?
A: Make sure the color you are editing matches one or more of the palette entries and that the lock palette option is unchecked, or the changes will not affect the palette.

Q: I keep getting lots of errors. Why won’t FastBit work?
A: Make sure Aseprite is updated to at least v1.2.19.2. If you still have unresolved issues, screen shot the error screen and post it here with a description of what you were doing when the error occurred.


I’m open for suggestions on how I can make it better, and of course to fix any bugs.

I have some ideas for which direction I want to take it, some changes that need to be made, and I need to make a README, but it works for now, so I’m releasing it into the world wild web. lol.

5 Likes

I seem to be getting an error message. Any ideas?

Aaaaaah. I thought I had squashed that bug. Bear with me, I’m currently working on a fix.

Try it now. I think I fixed what was causing it.

Also, if you are doing Game Boy Color art, each channel should be 5 bits each(32 values each), as the GBC used 15bit color(32,768 total colors). If you set all channels to 8 bits, you’ll be using the full 24 bit color space(16.7m colors!).

1 Like

Thanks for the update! I’m really excited to use this as it’s been a pain trying to convert my colors.

Unfortunately I’m still getting some errors. I’m on Aseprite v1.2.15 on macOS. Maybe I should try it on PC? I have a virtual machine installed with Windows 10.

When it first boots up I get this message:

Then it lets me cancel and choose my values, but it gives me a second error after clicking OK:

Yeah. It may be the version.

I’m on version 1.2.19.2 on Win 10. It works perfectly on my system, and unfortunately I have no other devices to test on.

1 Like

this script is epic! thank you for sharing it.
i’ve made few small changes and it works like a charm.

if you’re interested, here’s what i’ve changed:

  • math.ceil in setColors and swatchUpdate to math.floor, so instead of sequence 0, 37, 73, 110…255 for 9-bit i get 0,36,72,109…255. ( which should be correct according to wikipedia and Palette - Sega Retro )
  • then i had to change slider set lines like this: dlgData.r7 = math.floor( inCol.red / rStep ) to dlgData.r7 = math.ceil( ( inCol.red / rStep ) - 0.5 ), otherwise after getFG the sliders set themselves one step higher than they should.

here are some comparisons (6-bit, 9-bit, 9-bit, 12-bit, 12-bit, 15-bit):
fastbit-edit-test-2 fastbit-edit-test fastbit-edit-test-3 fastbit-edit-test-4 fastbit-edit-test-5 fastbit-edit-test-6
disclaimer: i don’t really know what i’m doing. but so far it doesn’t seem like i manage to break it.
i also failed to check other palettes, because i didn’t find examples which would not differ in values. i have a suspicion there always be some mismatches.

anyway, thanks again, i wanted something like this for months.

1 Like

A quick update for other readers, esotericsean fixed his issue by updating Aseprite to v1.2.19.2

@Olga_Galvanova Hmm… That’s pretty close for math that I cooked up off the top of my head. Lol. v1.3 will definitely have better math. I’ll get to studying all of the bit depths to make sure the values match.

Also, I was thinking about having a drop down box on the setup screen with presets for common color palettes that with a single click will set the sliders. That way, it’s easier for beginners to set(or faster for those of us who are too lazy to slide three sliders. points at self).

1 Like

drop down menu sounds good! or maybe just one slider to set all channels?

speaking of laziness… i mean… productivity: could you add an option to change picked colour instantly after clicking on get fg/bg button?

oh, and may i throw in two ideas for you to consider?

  1. option to set up number of quantization steps instead of bit depth for weirdos who might want to use odd number of steps like for example 3: 0,127,255. (i don’t know about other people, but i’d use it).
  2. HSL/V version. not exactly related to bit color picker, i know, but i think it would be amazing helper for building palettes.

PS. if you haven’t come across jjhagar’s ultimate Aseprite Scripts Collection - #22 by hohlinger check it out.

I’ve tried multiple times to get colors with single clicks, but nothing seems to work. I’m trying some different options, but I just keep breaking FastBit when I do, and have to roll back… Lol.

  1. Hmm… Didn’t think of that. My mind was in bit mode. I could create an ‘advanced’ tick box to enable more complex value constraints like that.

  2. I mulled over HSL/V modes, but again, most of the bit era systems didn’t use HSL/V so I decided against it.

Let me fix the math and get click selecting of colors working for 1.3 and then I’ll look into the other bells and whistles. Thanks for the input. You’ve definitely given me some good next steps.