forked from organicmaps/organicmaps
add debug function for graphics::Color
This commit is contained in:
parent
c0f8d299f5
commit
9f40dca617
1 changed files with 12 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "../std/stdint.hpp"
|
||||
#include "../std/string.hpp"
|
||||
#include "../std/sstream.hpp"
|
||||
|
||||
namespace graphics
|
||||
{
|
||||
|
@ -34,4 +36,14 @@ namespace graphics
|
|||
inline int greenFromARGB(uint32_t c) {return (c >> 8) & 0xFF; }
|
||||
inline int blueFromARGB(uint32_t c) {return (c & 0xFF); }
|
||||
inline int alphaFromARGB(uint32_t c) {return (c >> 24) & 0xFF;}
|
||||
|
||||
string DebugPrint(Color const & c)
|
||||
{
|
||||
ostringstream os;
|
||||
os << "r: " << (int)c.r << " ";
|
||||
os << "g: " << (int)c.g << " ";
|
||||
os << "b: " << (int)c.b << " ";
|
||||
os << "alpha: " << (int)c.a;
|
||||
return os.str();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue