diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-18 10:55:55 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-18 10:55:55 (GMT) |
commit | e0c79b3b885f126a2a2a34cb0d5df90796821130 (patch) | |
tree | d53e7a822a02ebc7ae136d01db18475be4283854 /Swiften/Whiteboard/Elements/Color.h | |
parent | f3cc4c80787657ea770468915ec716dea2676d22 (diff) | |
download | swift-contrib-e0c79b3b885f126a2a2a34cb0d5df90796821130.zip swift-contrib-e0c79b3b885f126a2a2a34cb0d5df90796821130.tar.bz2 |
Completed serialization and parsing of line element
Diffstat (limited to 'Swiften/Whiteboard/Elements/Color.h')
-rw-r--r-- | Swiften/Whiteboard/Elements/Color.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Swiften/Whiteboard/Elements/Color.h b/Swiften/Whiteboard/Elements/Color.h new file mode 100644 index 0000000..b7cca5a --- /dev/null +++ b/Swiften/Whiteboard/Elements/Color.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2012 Mateusz Piękos + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <string> + +namespace Swift { + class Color { + public: + Color(); + Color(int red, int green, int blue, int alpha = 255); + Color(const std::string& hex); + std::string toHex() const; + int getRed() const; + int getGreen() const; + int getBlue() const; + int getAlpha() const; + void setAlpha(int alpha); + + private: + std::string intToStr(int t, int base = 10) const; + + int red_, green_, blue_; + int alpha_; + }; +} |