summaryrefslogtreecommitdiff
path: root/include/tools/color.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-05-12 12:29:20 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-05-15 19:51:06 +0200
commit599328b0a9f50f65d8ad1efea8b72ac604153c56 (patch)
treea3a8192e2c03a0c3c7d44708ff1fe7b3f429b97e /include/tools/color.hxx
parent1c77fcacbd07b077412048a0647271fad16ff461 (diff)
tools: add AsRGBHexString to Color + unit test
AsRGBHexString returns the Color as a RGB hex string. For example "00ff00" for green color. Change-Id: Ia95c7f9eb6d9aefc3ca989046fa8d76b7b7f9e8f
Diffstat (limited to 'include/tools/color.hxx')
-rw-r--r--include/tools/color.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 0a55132a6fc9..3515e59b7ed3 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -162,6 +162,10 @@ public:
TOOLS_DLLPUBLIC friend SvStream& ReadColor( SvStream& rIStream, Color& rColor );
TOOLS_DLLPUBLIC friend SvStream& WriteColor( SvStream& rOStream, const Color& rColor );
+ // Return color as RGB hex string
+ // for example "00ff00" for green color
+ OUString AsRGBHexString();
+
// get ::basegfx::BColor from this color
::basegfx::BColor getBColor() const { return ::basegfx::BColor(GetRed() / 255.0, GetGreen() / 255.0, GetBlue() / 255.0); }
};