Opened 11 years ago

Closed 11 years ago

#413 closed task (fixed)

configure colors in plot

Reported by: Peter Johansson Owned by: Jari Häkkinen
Priority: minor Milestone: svndigest 0.8
Component: configuration Version: trunk
Keywords: Cc:

Description

needs ticket #75

In ticket:75 each author will get its own color in the plots. At time of writing this it is not decided how these colors will be chosen, but quite certain they will be hard-coded. Perhaps we should let user override these choices by setting colors in config file.

Change History (8)

comment:1 Changed 11 years ago by Jari Häkkinen

Owner: changed from Peter Johansson to Jari Häkkinen
Status: newassigned

I am using the colour selected for blame output also for the plots. Comments?

comment:2 Changed 11 years ago by Jari Häkkinen

Milestone: svndigest 0.x+svndigest 0.8

comment:3 in reply to:  1 ; Changed 11 years ago by Peter Johansson

Replying to jari:

I am using the colour selected for blame output also for the plots. Comments?

I think that is the way to go. I think it should be like this:

Color in plot and color in blame is the same. Color is chosen according to scheme in class Colours. Choice can be overridden in config file, section [author-color]. Currently we support any string that the browsers can understand as a color, typically a sex-digit hexadecimal number (aa0000) but I think also the shorter form (a00) is accepted. I think we should also support 137,0,0.

The configuration class need to understand these formats , and I think we should save the to color maps: one with <author, string> and one <author, color> where color is a new struct only containing three unsigned short. In addition to Configuration::author_str_color we should a similar function that returns a const color&. How these should be used in the output should be pretty straightforward.

If you think this sounds good, but would prefer that I implement any sub-task, please open a new ticket with that sub-task.

comment:4 in reply to:  3 ; Changed 11 years ago by Jari Häkkinen

Replying to peter:

Color in plot and color in blame is the same. Color is chosen according to scheme in class Colours. Choice can be overridden in config file, section [author-color]. Currently we support any string that the browsers can understand as a color, typically a sex-digit hexadecimal number (aa0000) but I think also the shorter form (a00) is accepted. I think we should also support 137,0,0.

I have added code that converts RRGGBB to the format accepted by plplot. The other formats will break the current code. However, when the svndigest repo is open for commits again I'll add support for the other formats.

The configuration class need to understand these formats , and I think we should save the to color maps: one with <author, string> and one <author, color> where color is a new struct only containing three unsigned short. In addition to Configuration::author_str_color we should a similar function that returns a const color&. How these should be used in the output should be pretty straightforward.

I think it is customary to us unsigned char for r,g,b. There is already a colour struct in Colour (which I'll rename to Color soon, we cannot mix color and colour). Also, I am about to commit code that does not fully comply to the above. Check it out and then we discuss how we want it to be.

comment:5 Changed 11 years ago by Jari Häkkinen

(In [928]) Addresses #413. Same colour for authors for all blame output and plots. Colours from config used.

comment:6 in reply to:  4 Changed 11 years ago by Peter Johansson

Replying to jari:

Replying to peter: However, when the svndigest repo is open for commits again I'll add support for the other formats.

I'll have a look at ticket:415 and after that I will release 0.7.1 and merge it into trunk.

I think it is customary to us unsigned char for r,g,b.

OK

comment:7 Changed 11 years ago by Peter Johansson

(In [931]) refs #413 adding support for shorter hexadecimal color format (e.g. 'a0b equivalent to 'aa00bb')

comment:8 Changed 11 years ago by Jari Häkkinen

Resolution: fixed
Status: assignedclosed

(In [944]) Fixes #413, well it finalized the ticket.

Note: See TracTickets for help on using tickets.