Added color utilities; implemented more of Graph related classes

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@76 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-19 20:56:51 +00:00
parent a218251fd6
commit 1836cf4de9
6 changed files with 224 additions and 19 deletions
+7 -1
View File
@@ -144,7 +144,7 @@ class ContourMask {
UInt *lefts, *rights;
};
// ----------------------------------------------------------------------------- : Utility
// ----------------------------------------------------------------------------- : Color utility functions
inline int bot(int x) { return max(0, x); } ///< bottom range check for color values
inline int top(int x) { return min(255, x); } ///< top range check for color values
@@ -153,5 +153,11 @@ inline int col(int x) { return top(bot(x)); } ///< top and bottom range check fo
/// Linear interpolation between colors
Color lerp(const Color& a, const Color& b, double t);
/// convert HSL to RGB, h,s,l must be in range [0...1)
Color hsl2rgb(double h, double s, double l);
/// A darker version of a color
Color darken(const Color& c);
// ----------------------------------------------------------------------------- : EOF
#endif