unify color system

Asked by Michael Wayne Goodman on 2009-03-26

Currently the color systems are idiosyncratic for each plot. The current settings look very nice and should be left as the default, but if I, say, want to have a linear gradient on a pie chart or no gradient on a bar chart, then i should be able to.

I can imagine a couple possible solutions:

(1) create a Color class that is used by all plots, and specifies not only the color, but the fill type (radial/linear/no gradient) and perhaps other parameters as well.

(2) have all plots interface for color specifications the same way. for example, some_plot = a_plot(..., colors=[(.2,.2,.8,'solid'),(.8,.2,.2,'linear')], ...)

Also, it would be nice to have pattern fills. For example, instead of a gradient, i may want a hatch or dot pattern to fill the shape. This should be possible with Cairo surfaces. (but really this is a separate feature request and should be in a different bug)

Question information

English Edit question
Cairo Plot Edit question
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #348831.

Magnun Leno (magnun-leno) said : #1

It's a really good suggestion!

Currently I'm developing a data structure to simplify the arguments used in each plot. In this structure is predicted to have the colors of each 'group'. I'll add the 'field' for the filling type (radial, gradient, linear). Any other suggestion?

I think you can consider it as a planned feature! Just waiting Rodrigo's approval.


Magnun Leno (magnun-leno) said : #2

Converting this bug into a question, since it's a suggestion :)

Hi Magnun, good to hear that someone agrees with my proposal. Do you think the pattern-fill part is doable? Or should it be a different bug?

Also, I'm still fairly new to using Launchpad, so I'm not totally sure how content is divided, but this seems more of a feature-request than a question. Perhaps the bug should be labeled "wishlist"? Or maybe it could be a blueprint?

Actually it should be created as a blueprint.
But I don't know if blueprints support discussion, so let's stay here for a while.

Totally agreed with the color specifications idea. I'll make the arrangements for everyone to understand the fourth field (linear, radial or solid).

For the pattern filling, let's postpone it for a while (maybe on version 2.1) as we are making the arrangements to release version 2.0.

Ok, on revision 37 it now works as said.
Colors might have a 5th field which might be 'solid', 'linear' or 'radial'.
CairoPlot now accepts it but doesn't fully uses it yet. For now, it's only possible to use the 'solid' option to create BarPlots with solid colors or PiePlots or DonutPlots with solid colors without using the gradient attribute.

By the way, that gradient attribute on Pie and Donut Plots will be "deprecated" as this new approach overcomes it.

Can you help with this problem?

Provide an answer of your own, or ask Michael Wayne Goodman for more information if necessary.

To post a message you must log in.