mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +00:00
LibDraw: Give Color::lightened() an amount argument
This commit is contained in:
parent
2cdab2c925
commit
8ae826f5c3
1 changed files with 3 additions and 3 deletions
|
@ -138,14 +138,14 @@ public:
|
|||
return Color(gray, gray, gray, alpha());
|
||||
}
|
||||
|
||||
Color darkened(float amount = 0.5) const
|
||||
Color darkened(float amount = 0.5f) const
|
||||
{
|
||||
return Color(red() * amount, green() * amount, blue() * amount, alpha());
|
||||
}
|
||||
|
||||
Color lightened() const
|
||||
Color lightened(float amount = 1.2f) const
|
||||
{
|
||||
return Color(min(255.0, red() * 1.2), min(255.0, green() * 1.2), min(255.0, blue() * 1.2), alpha());
|
||||
return Color(min(255, (int)((float)red() * amount)), min(255, (int)((float)green() * amount)), min(255, (int)((float)blue() * amount)), alpha());
|
||||
}
|
||||
|
||||
Color inverted() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue