Opened 7 years ago
Closed 5 years ago
#32 closed enhancement (fixed)
lua get used/unique colors functions
|Reported by:||HoraK-FDF||Owned by:||PulkoMandy|
is it possible to add functions for lua scripting that can return the number of used or unique colors without the automatic added save palette colors?
Here is an example how i would use this feature:
I'm currently working with 8x8 bitmap fonts some have only two colors (0, 1) and some may have more colors. The fonts with two colors are diffrently handeled than the ones with more colors (i can choose with color color 1 has in the output, color 0 will be not drawn) so i need an bool value (multicolor 0/1) that my grafx2 font-to-assembler lua script can output depending on the number of colors and with that bool value i can upgrade the output functions of my current Gameboy Advance Project. I can also make this bool value everytime by hand but because i will create many different fonts for the Project it would be nicer when the export script can do this by it self.
Change History (6)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Yes that's what i'm looking for ... nice thanks.
And sorry for the late reply.
comment:3 by , 5 years ago
So this is fixed, right ?
comment:4 by , 5 years ago
|Milestone:||2.5 → 2.6|
comment:5 by , 5 years ago
|Status:||new → assigned|
comment:6 by , 5 years ago
|Status:||assigned → closed|
My dawnbringer_lib.lua library includes the functions:
Number of Unique colors in palette:
n = #db.fixPalette(db.makePalList(256)) -- A value of 252 would omitt the last 4 pal-cols
Number of Colors in Image:
n = #db.makePalListFromHistogram(db.makeHistogram())
Number of Unique colors in Image:
n = #db.fixPalette(db.makePalListFromHistogram(db.makeHistogram()))
Is that what you are looking for?