Adapt the formatting
parent
9c52fd7633
commit
e299f71cfe
|
@ -145,7 +145,6 @@ std::string DecimalToHexa( T toConvert ) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @fn Rgba2Hex
|
|
||||||
/// @brief translate RGBA to String
|
/// @brief translate RGBA to String
|
||||||
/// @param r aiColor.r
|
/// @param r aiColor.r
|
||||||
/// @param g aiColor.g
|
/// @param g aiColor.g
|
||||||
|
@ -153,13 +152,13 @@ std::string DecimalToHexa( T toConvert ) {
|
||||||
/// @param a aiColor.a
|
/// @param a aiColor.a
|
||||||
/// @param with_head #
|
/// @param with_head #
|
||||||
/// @return The hexadecimal string, is empty in case of an error.
|
/// @return The hexadecimal string, is empty in case of an error.
|
||||||
AI_FORCE_INLINE
|
AI_FORCE_INLINE std::string Rgba2Hex(int r, int g, int b, int a, bool with_head) {
|
||||||
std::string Rgba2Hex(int r, int g, int b, int a, bool with_head)
|
|
||||||
{
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
if (with_head)
|
if (with_head) {
|
||||||
ss << "#";
|
ss << "#";
|
||||||
|
}
|
||||||
ss << std::hex << (r << 24 | g << 16 | b << 8 | a);
|
ss << std::hex << (r << 24 | g << 16 | b << 8 | a);
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue