summaryrefslogtreecommitdiffstats
path: root/core/color.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-01-12 00:08:32 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-01-12 00:08:32 -0300
commit2cde466ebdb6237b6f72ef78614dc05f2ffb551b (patch)
tree2b90d0b53d372c1a8c76343b8ad491403624aed9 /core/color.h
parentc48aab2f05d931fbab6bf0702e81e45b5cd88aa1 (diff)
downloadredot-engine-2cde466ebdb6237b6f72ef78614dc05f2ffb551b.tar.gz
-Remove color operator clamping, which is unnecesary. Fixes #15184, fixes #14686.
-Refresh progress bar less often, makes baking, exporting, etc. faster.
Diffstat (limited to 'core/color.h')
-rw-r--r--core/color.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/color.h b/core/color.h
index 0ff4fe6edd..9af8fb0a78 100644
--- a/core/color.h
+++ b/core/color.h
@@ -105,18 +105,18 @@ struct Color {
_FORCE_INLINE_ Color darkened(float p_amount) const {
Color res = *this;
- res.r = CLAMP(res.r * (1.0f - p_amount), 0.0, 1.0);
- res.g = CLAMP(res.g * (1.0f - p_amount), 0.0, 1.0);
- res.b = CLAMP(res.b * (1.0f - p_amount), 0.0, 1.0);
+ res.r = res.r * (1.0f - p_amount);
+ res.g = res.g * (1.0f - p_amount);
+ res.b = res.b * (1.0f - p_amount);
return res;
}
_FORCE_INLINE_ Color lightened(float p_amount) const {
Color res = *this;
- res.r = CLAMP(res.r + (1.0f - res.r) * p_amount, 0.0, 1.0);
- res.g = CLAMP(res.g + (1.0f - res.g) * p_amount, 0.0, 1.0);
- res.b = CLAMP(res.b + (1.0f - res.b) * p_amount, 0.0, 1.0);
+ res.r = res.r + (1.0f - res.r) * p_amount;
+ res.g = res.g + (1.0f - res.g) * p_amount;
+ res.b = res.b + (1.0f - res.b) * p_amount;
return res;
}