Changeset 916


Ignore:
Timestamp:
Nov 30, 2009, 9:02:40 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Addresses #75. Added author colouring. Currently jari and peter gets non-black hard-coded colour.

Location:
trunk/lib
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Graph.h

    r902 r916  
    5959    ~Graph(void);
    6060
    61     static bool date_xticks(void);
    62 
    6361    /**
    6462       \brief Set the pen colour to use in next drawing call
    6563    */
    6664    void current_colour(unsigned char r, unsigned char g, unsigned char b);
     65
     66    static bool date_xticks(void);
    6767
    6868    /**
     
    111111  private:
    112112
     113    // Copy constructor not implemented
     114    Graph(const Graph&);
     115
    113116    struct legend_data {
    114117      std::string label;
  • trunk/lib/Makefile.am

    r909 r916  
    3333
    3434noinst_HEADERS = AddStats.h Alias.h BlameStats.h ClassicStats.h \
    35   Commitment.h Configuration.h css.h \
     35  Colours.h Commitment.h Configuration.h css.h \
    3636  Date.h Directory.h File.h first_page.h Functor.h \
    3737  Graph.h \
     
    4343
    4444libsvndigest_a_SOURCES = AddStats.cc Alias.cc BlameStats.cc \
    45   ClassicStats.cc \
     45  ClassicStats.cc Colours.cc \
    4646  Commitment.cc Configuration.cc \
    4747  css.cc Date.cc Directory.cc File.cc first_page.cc\
  • trunk/lib/Stats.cc

    r884 r916  
    2424#include "Stats.h"
    2525
     26#include "Colours.h"
    2627#include "Functor.h"
    2728#include "Graph.h"
     
    385386    std::sort(author_cont.begin(), author_cont.end(), compare);
    386387
    387     size_t plotno=author_cont.size();
    388388    vec_type::iterator end(author_cont.end());
    389389    for (vec_type::iterator i(author_cont.begin()); i!=end; ++i) {
    390       // the RGB values below must be replaced ... seg fault will
    391       // happen! plotno will probably become unused when below row is
    392       // removed or fixed.
    393       gp.current_colour(25*plotno,255-25*plotno,75);
     390      unsigned char r, g, b;
     391      Colours::instance().get_colour(i->first,r,g,b);
     392      gp.current_colour(r,g,b);
    394393      gp.plot(i->second, i->first, get_back(*stat, i->first));
    395394    }
Note: See TracChangeset for help on using the changeset viewer.