Commit 239daae6 authored by Cyrille Berger's avatar Cyrille Berger

add some convenient function to set/get alpha

svn path=/trunk/koffice/; revision=755454
parent a479ed9e
......@@ -264,6 +264,15 @@ void KoColor::toXML(QDomDocument& doc, QDomElement& colorElt) const
d->colorSpace->colorToXML( d->data, doc, colorElt);
}
void KoColor::setOpacity(quint8 alpha )
{
d->colorSpace->setAlpha( d->data, alpha, 1);
}
quint8 KoColor::opacity() const
{
d->colorSpace->alpha( d->data );
}
KoColor KoColor::fromXML(const QDomElement& elt, QString bitDepthId, QHash<QString, QString> aliases)
{
QString modelId;
......
......@@ -96,6 +96,15 @@ public:
void toQColor(QColor *c) const;
/// a convenience method for the above.
QColor toQColor() const;
/**
* Convenient function to set the opacity of the color.
*/
void setOpacity(quint8 alpha );
/**
* Convenient function that return the opacity of the color
*/
quint8 opacity() const;
// what about making the next two methods static factory methods?
/// Convenient function for converting from a QColor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment