mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 14:07:01 -04:00
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:
+7
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user