mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Added value actions for common value types; drop down list is now correctly aligned
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@92 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -46,3 +46,13 @@ Color darken(const Color& c) {
|
||||
c.Blue() * 8 / 10
|
||||
);
|
||||
}
|
||||
|
||||
Color saturate(const Color& c, double amount) {
|
||||
int r = c.Red(), g = c.Green(), b = c.Blue();
|
||||
double l = (r + g + b) / 3;
|
||||
return Color(
|
||||
col((r - amount * l) / (1 - amount)),
|
||||
col((g - amount * l) / (1 - amount)),
|
||||
col((b - amount * l) / (1 - amount))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -169,5 +169,8 @@ Color hsl2rgb(double h, double s, double l);
|
||||
/// A darker version of a color
|
||||
Color darken(const Color& c);
|
||||
|
||||
/// A saturated version of a color
|
||||
Color saturate(const Color& c, double amount);
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user