Wakamai-Fondue / wakamai-fondue-engine

The engine that powers Wakamai Fondue
Apache License 2.0
46 stars 9 forks source link

Return CPAL color palettes #20

Closed RoelN closed 3 years ago

RoelN commented 3 years ago

Note: colorRecords contains one single array. Our test font has just one CPAL palette, so this is fine. What happens when multiple palettes are in the font?

(Assumption: colors are listed in one big array and you have to "cut" them into the separate palettes based on the number of colors per palette)

RoelN commented 3 years ago

Proposing to merge this as-is, as is properly deals with current color fonts, since multiple palettes aren't supported anywhere yet. In case of a font with multiple palettes, WF will show all colors belonging to the same palette. This might be a little confusing, but better than not reporting on palette colors at all ;-)

RoelN commented 3 years ago

@pascalw Thanks for your suggestions!

In the meantime I found a font with multiple palettes and added that functionality. Instead of one array of colors, it now returns an array with arrays of colors.

E.g. two palettes of two colors each:

["#000000", "#100000", "#200000", "#300000"]

[["#000000", "#100000"], ["#200000", "#300000"]]

RoelN commented 3 years ago

~@pascalw Hmm, this new return setup now results in this linter error:~

~Expected getter 'colorPalettes' to always return a value getter-return~

RoelN commented 3 years ago

@pascalw Fixed, my bad. Would you mind taking a look at this new setup?