Changeset 919 for trunk/lib/Colours.h


Ignore:
Timestamp:
Dec 1, 2009, 12:03:31 AM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #75. Colours are dynamically assigned to authors. Removed white from the colour map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Colours.h

    r916 r919  
    3030namespace svndigest {
    3131
     32  /**
     33     The author-colour mapping is provided by the Colours class.
     34
     35     Colours use the singleton design pattern.
     36   */
    3237  class Colours
    3338  {
    3439  public:
    3540
     41    /**
     42       \brief Get RGB colour for \a label
     43
     44       If \a label has no assigned colour, the next unused colour is
     45       automatically assigned to \a label. The number of available
     46       unique colours is low, when all colours are used mapped with a
     47       \a label once, the colours are reused.
     48
     49       \see To be written. If a specific colour is to be assigned for
     50       a label, use function TBA.
     51     */
    3652    void get_colour(const std::string& label, unsigned char& r,
    37                     unsigned char& g, unsigned char& b) const;
     53                    unsigned char& g, unsigned char& b);
    3854
     55    /**
     56       \brief Get an instance of Colour
     57     */
    3958    static Colours& instance(void);
    4059
     
    5776    };
    5877
     78    std::map<std::string, std::vector<colour>::iterator> author_map_;
     79    std::vector<colour> colour_map_;
    5980    static Colours* instance_;
    60     std::vector<colour> colour_map_;
    61     std::map<std::string, std::vector<colour>::iterator> author_map_;
     81    std::vector<colour>::iterator next_colour_;
    6282  };
    6383
Note: See TracChangeset for help on using the changeset viewer.