Opened 8 years ago

Closed 5 years ago

#32 closed enhancement (fixed)

lua get used/unique colors functions

Reported by: HoraK-FDF Owned by: PulkoMandy
Priority: major Milestone: 2.6
Component: GrafX2 Version: 2.5
Keywords: Cc:

Description

Hi,

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 DawnBringer, 8 years ago

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?

comment:2 by HoraK-FDF, 7 years ago

Yes that's what i'm looking for ... nice thanks.
And sorry for the late reply.

comment:3 by Thomas Bernard, 6 years ago

So this is fixed, right ?

comment:4 by PulkoMandy, 6 years ago

Milestone: 2.52.6

comment:5 by PulkoMandy, 6 years ago

Owner: changed from Adrien Destugues to PulkoMandy
Status: newassigned

comment:6 by Thomas Bernard, 5 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.