← Back to team overview

kicad-developers team mailing list archive

RFC: Arbitrary color support

 

Hi all,

I started working on the idea of a color theme system for KiCad, starting
with the schematic editor.

This change relies on a complete removal of EDA_COLOR_T from the code, and
replacement with a color structure that can handle arbitrary colors.  I
think this is important and the right path for the future, but since it's a
significant change, I wanted to get buy-in before going any farther down
this road.  I can understand the reasons for using an enum for
color--especially since it lets the developers restrict the colors to those
that will work well with the drawing technique of the legacy canvases.
But, since the new canvases will have no problem supporting arbitrary
colors, I think it makes sense to start setting up the groundwork for that.

In my test code, I have replaced EDA_COLOR_T with wxColour, since that is
used internally in a few places already, and it was pretty simple (although
somewhat time-consuming) to replace all usages.  wxColour has the nice
property of serializing/deserializing from hex color codes like "#80FC62"
so that's what I use for storing in the settings for now (eventually I
think color settings should be in their own files so that they can be
traded by users).  Plus, there is a canned wxColourPicker widget that I can
use in place of the custom color picker buttons that are used in the
settings today.

You can see some screenshots of the (work-in-progress) settings dialog
changes, and an example of a custom color theme in the schematic editor,
here:
http://imgur.com/a/MxMmb

So, any feedback from the core team?  Any reason why I shouldn't move
forward with preparing a patch to move from EDA_COLOR_T to wxColour across
the board?

Best,
Jon

Follow ups