00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef STYLECOLOUR_H
00029 #define STYLECOLOUR_H
00030
00031 #include "enums.h"
00032
00033 #include <string>
00034
00035
00036 using namespace std;
00037
00038 namespace highlight
00039 {
00040
00045 struct RGBVal
00046 {
00047 int iRed,
00048 iGreen,
00049 iBlue;
00050 };
00051
00052 class Colour
00053 {
00054 public:
00060 Colour ( const string & red, const string & green, const string & blue );
00061
00065 Colour ( const string & colourString );
00066
00067 Colour();
00068 ~Colour() {};
00069
00073 void setRGB ( const string & colourString );
00074
00075
00078 void setRed ( const string & red );
00079
00082 void setGreen ( const string & green );
00083
00086 void setBlue ( const string & blue );
00087
00090 string getRed ( OutputType type ) const;
00093 string getGreen ( OutputType type ) const;
00096 string getBlue ( OutputType type ) const;
00097
00098 private:
00099 RGBVal rgb;
00100 string int2str ( int, std::ios_base& ( *f ) ( std::ios_base& ) ) const;
00101 string float2str ( double ) const;
00102 };
00103
00104 }
00105
00106 #endif