summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Clark Moody <clark@clarkmoody.com>2020-03-31 16:09:06 -0500
committerLibravatar Clark Moody <clark@clarkmoody.com>2020-04-24 15:13:22 -0500
commitbb443988197ecfbb1effe9ae73ec5533db7e3339 (patch)
treea33c0dafbb3f626ef1621577434564905dc2667e /core
parent4009f0cf73cdf261a3218a44706fdd1434653c8f (diff)
downloadiced-bb443988197ecfbb1effe9ae73ec5533db7e3339.tar.gz
iced-bb443988197ecfbb1effe9ae73ec5533db7e3339.tar.bz2
iced-bb443988197ecfbb1effe9ae73ec5533db7e3339.zip
Revert from_rgb to const
Diffstat (limited to 'core')
-rw-r--r--core/src/color.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/color.rs b/core/src/color.rs
index 33eeedaf..4ac2f8a7 100644
--- a/core/src/color.rs
+++ b/core/src/color.rs
@@ -52,8 +52,8 @@ impl Color {
/// Creates a [`Color`] from its RGB components.
///
/// [`Color`]: struct.Color.html
- pub fn from_rgb(r: f32, g: f32, b: f32) -> Color {
- Color::new(r, g, b, 1.0)
+ pub const fn from_rgb(r: f32, g: f32, b: f32) -> Color {
+ Color { r, g, b, a: 1.0 }
}
/// Creates a [`Color`] from its RGB8 components.