summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorTomasz Boczkowski <penginsbacon@gmail.com>2014-06-01 11:03:36 +0000
committerTomasz Boczkowski <penginsbacon@gmail.com>2014-06-01 11:03:36 +0000
commitbb5dacfc027558432b9a46f61329d7bd02731571 (patch)
tree3fa583070f770604844534c1bdc6ed577e798064 /src/ui
parentSPColorNotebook cleanup (diff)
downloadinkscape-bb5dacfc027558432b9a46f61329d7bd02731571.tar.gz
inkscape-bb5dacfc027558432b9a46f61329d7bd02731571.zip
Using SelectedColor in extenstion/param/color
(bzr r13341.6.45)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/selected-color.cpp12
-rw-r--r--src/ui/selected-color.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/selected-color.cpp b/src/ui/selected-color.cpp
index 24720f870..ed3e06e2f 100644
--- a/src/ui/selected-color.cpp
+++ b/src/ui/selected-color.cpp
@@ -58,6 +58,18 @@ gfloat SelectedColor::alpha() const
return _alpha;
}
+void SelectedColor::setValue(guint32 value)
+{
+ SPColor color(value);
+ gfloat alpha = SP_RGBA32_A_F(value);
+ setColorAlpha(color, alpha);
+}
+
+guint32 SelectedColor::value() const
+{
+ return color().toRGBA32(_alpha);
+}
+
void SelectedColor::setColorAlpha(SPColor const &color, gfloat alpha)
{
#ifdef DUMP_CHANGE_INFO
diff --git a/src/ui/selected-color.h b/src/ui/selected-color.h
index 9f86d4255..b4268f553 100644
--- a/src/ui/selected-color.h
+++ b/src/ui/selected-color.h
@@ -39,6 +39,9 @@ public:
void setAlpha(gfloat alpha);
gfloat alpha() const;
+ void setValue(guint32 value);
+ guint32 value() const;
+
void setColorAlpha(SPColor const &color, gfloat alpha);
void colorAlpha(SPColor &color, gfloat &alpha) const;