sorcio / foxlearner

Automatically exported from code.google.com/p/foxlearner
0 stars 0 forks source link

Game-GUI colors interface #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Since pygame 1.8.1 does't understand colors like 'ORANGE', we should 
implement a preparser of those colors, then return a string in format rgba.

A dict simple should be ok, but _in_ bubbles, becouse every single interface 
needs to parse colors in 'FOO' format

Original issue reported on code.google.com by maker...@gmail.com on 3 Apr 2010 at 7:23

GoogleCodeExporter commented 9 years ago
There will be a couple places outside of GUI implementation where a color can 
be 
specified:
* GameObject descriptions in gamecore.py
* brainz (i.e. the high level interface for debug drawing by game components)
I don't think there ever will be a very different use case for colors.

In both the abovementioned cases the color description only needs to be 
approximate, 
whereas only GUI code will be responsible for interpreting a color description 
and 
translating it to a true RGB color or any other elaborate drawing.

So I'm moving bubbles and brainz to a color API which accept a common 
dictionary of 
colors. Any other GUI should accept the same color strings (although the 
interpretation could be different).

I chose Pygame colordict (pygame.colordict.THECOLORS) as a reference as we 
already 
depend on Pygame and it provides a RGB mapping, although I'd rather build our 
own 
dictionary either from scratch or from a source which we could integrate in the 
project without third party dependencies.

Original comment by sorcio@gmail.com on 8 Apr 2010 at 10:06

GoogleCodeExporter commented 9 years ago

Original comment by maker...@gmail.com on 8 Apr 2010 at 3:33

GoogleCodeExporter commented 9 years ago
Reopen, still work to be done

Original comment by sorcio@gmail.com on 8 Apr 2010 at 10:34

GoogleCodeExporter commented 9 years ago

Original comment by sorcio@gmail.com on 8 Apr 2010 at 11:13