diff options
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/selected-color.cpp | 12 | ||||
| -rw-r--r-- | src/ui/selected-color.h | 3 |
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; |
