From dab5a2c5778cb80a633d34fcadf5a3d972c0f90e Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sun, 24 Nov 2002 00:27:34 +0000 Subject: [PATCH] Forgot those :) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2072 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/prefs/screen/Utility.cpp | 23 +++++++++++++++++++++++ src/prefs/screen/Utility.h | 16 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/prefs/screen/Utility.cpp create mode 100644 src/prefs/screen/Utility.h 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