summaryrefslogtreecommitdiff
path: root/include/tools/color.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/tools/color.hxx')
-rw-r--r--include/tools/color.hxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index fa62f28f362b..10dd3d3aea6e 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -162,6 +162,19 @@ public:
static Color HSBtoRGB(sal_uInt16 nHue, sal_uInt16 nSaturation, sal_uInt16 nBrightness);
void RGBtoHSB(sal_uInt16& nHue, sal_uInt16& nSaturation, sal_uInt16& nBrightness) const;
+ /** Converts a string into a color. Supports:
+ * #RRGGBB
+ * #rrggbb
+ * #RGB
+ * #rgb
+ * RRGGBB
+ * rrggbb
+ * RGB
+ * rgb
+ * If fails returns Color().
+ */
+ static Color STRtoRGB(const OUString& colorname);
+
bool operator==(const Color& rColor) const
{
return mValue == rColor.mValue;
@@ -171,10 +184,16 @@ public:
return !(Color::operator==(rColor));
}
- // Return color as RGB hex string
+ // Return color as RGB hex string: rrggbb
// for example "00ff00" for green color
OUString AsRGBHexString() const;
+ /* Return color as RGB hex string: RRGGBB
+ * for example "00FF00" for green color
+ * @return hex string
+ */
+ OUString AsRGBHEXString() const;
+
// get ::basegfx::BColor from this color
basegfx::BColor getBColor() const
{