color_t: added an empty() function
This commit is contained in:
parent
fa3c4682db
commit
9aff81a89c
1 changed files with 5 additions and 0 deletions
|
@ -188,6 +188,11 @@ struct color_t
|
|||
/** Alpha value */
|
||||
uint8_t a;
|
||||
|
||||
bool empty(const bool check_alpha = true) const
|
||||
{
|
||||
return r ==0 && g == 0 && b == 0 && (check_alpha ? a == 0 : true);
|
||||
}
|
||||
|
||||
bool operator==(const color_t& c) const
|
||||
{
|
||||
return r == c.r && g == c.g && b == c.b && a == c.a;
|
||||
|
|
Loading…
Add table
Reference in a new issue