mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibDraw: Give Color::lightened() an amount argument
This commit is contained in:
parent
2cdab2c925
commit
8ae826f5c3
Notes:
sideshowbarker
2024-07-19 10:43:33 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8ae826f5c3c
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…
Reference in a new issue