diff --git a/src/prefs/screen/Utility.cpp b/src/prefs/screen/Utility.cpp new file mode 100644 index 0000000000..d52d8fa0ce --- /dev/null +++ b/src/prefs/screen/Utility.cpp @@ -0,0 +1,23 @@ +#include "Utility.h" +#include + +rgb_color blackColor = { 0, 0, 0, 255 }; +rgb_color greyColor = { 216, 216, 216, 255 }; +rgb_color darkColor = { 184, 184, 184, 255 }; +rgb_color whiteColor = { 255, 255, 255, 255 }; +rgb_color redColor = { 228, 0, 0, 255 }; + +float round(float n, int32 max) +{ + float result; + int32 tmp; + max *= 10; + + n *= max; + n += 0.5; + + tmp = (int32)floor(n); + result = (float)tmp / (max); + + return result; +} diff --git a/src/prefs/screen/Utility.h b/src/prefs/screen/Utility.h new file mode 100644 index 0000000000..41ce436da7 --- /dev/null +++ b/src/prefs/screen/Utility.h @@ -0,0 +1,16 @@ +#ifndef __UTILITY_H +#define __UTILITY_H + +#include +#include + +extern float round(float n, int32 max); + +//Colors +extern rgb_color blackColor; +extern rgb_color greyColor; +extern rgb_color darkColor; +extern rgb_color whiteColor; +extern rgb_color redColor; + +#endif //__UTILITY_H \ No newline at end of file