diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/color.rs | 4 |
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. |