added alpha() method
This commit is contained in:
parent
04f86c3dc7
commit
eb7890cfe8
1 changed files with 9 additions and 3 deletions
|
@ -31,8 +31,8 @@ namespace mapnik {
|
||||||
Color()
|
Color()
|
||||||
:rgba_(0xffffffff) {}
|
:rgba_(0xffffffff) {}
|
||||||
|
|
||||||
Color(int red,int green,int blue)
|
Color(int red,int green,int blue,int alpha=0xff)
|
||||||
: rgba_(0xff<<24 | (blue&0xff) << 16 | (green&0xff) << 8 | red&0xff) {}
|
: rgba_((alpha&0xff) << 24 | (blue&0xff) << 16 | (green&0xff) << 8 | red&0xff) {}
|
||||||
|
|
||||||
explicit Color(int rgba)
|
explicit Color(int rgba)
|
||||||
: rgba_(rgba) {}
|
: rgba_(rgba) {}
|
||||||
|
@ -58,6 +58,12 @@ namespace mapnik {
|
||||||
{
|
{
|
||||||
return rgba_&0xff;
|
return rgba_&0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline int alpha() const
|
||||||
|
{
|
||||||
|
return (rgba_>>24)&0xff;
|
||||||
|
}
|
||||||
|
|
||||||
inline int rgba() const
|
inline int rgba() const
|
||||||
{
|
{
|
||||||
return rgba_;
|
return rgba_;
|
||||||
|
|
Loading…
Add table
Reference in a new issue