summaryrefslogtreecommitdiff
path: root/Libraries/LibDraw
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-24 02:24:49 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-24 02:25:50 +0100
commit8ae826f5c3ce8755d88199ce67dd9f71f60e2eea (patch)
treee8fb115761aa13c13f54112694faeae798634e13 /Libraries/LibDraw
parent2cdab2c925efbed3aa02f70e5ce8b8211f249e1f (diff)
downloadserenity-8ae826f5c3ce8755d88199ce67dd9f71f60e2eea.zip
LibDraw: Give Color::lightened() an amount argument
Diffstat (limited to 'Libraries/LibDraw')
-rw-r--r--Libraries/LibDraw/Color.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Libraries/LibDraw/Color.h b/Libraries/LibDraw/Color.h
index 2d10792299..976ab3a5c0 100644
--- a/Libraries/LibDraw/Color.h
+++ b/Libraries/LibDraw/Color.h
@@ -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