summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Whiteboard/Elements/Color.h')
-rw-r--r--Swiften/Whiteboard/Elements/Color.h30
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_;
+ };
+}