ColorReference.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libmspub project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef __COLORREFERENCE_H__
00011 #define __COLORREFERENCE_H__
00012 
00013 #include "MSPUBTypes.h"
00014 
00015 namespace libmspub
00016 {
00017 class ColorReference
00018 {
00019   unsigned m_baseColor;
00020   unsigned m_modifiedColor;
00021 //  static const unsigned char COLOR_PALETTE;
00022   static const unsigned char CHANGE_INTENSITY;
00023   static const unsigned char BLACK_BASE;
00024   static const unsigned char WHITE_BASE;
00025   Color getRealColor(unsigned c, const std::vector<Color> &palette) const;
00026 public:
00027   explicit ColorReference(unsigned color) : m_baseColor(color), m_modifiedColor(color) { }
00028   ColorReference(unsigned baseColor, unsigned modifiedColor) : m_baseColor(baseColor), m_modifiedColor(modifiedColor) { }
00029   Color getFinalColor(const std::vector<Color> &palette) const;
00030 public:
00031   friend bool operator==(const libmspub::ColorReference &, const libmspub::ColorReference &);
00032 };
00033 }
00034 
00035 #endif /* __COLORREFERENCE_H__ */
00036 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */