diff options
Diffstat (limited to '')
| -rw-r--r-- | core/src/color.rs | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/core/src/color.rs b/core/src/color.rs index b7445a8c..4f0d974b 100644 --- a/core/src/color.rs +++ b/core/src/color.rs @@ -65,7 +65,14 @@ impl Color {      ///      /// [`Color`]: struct.Color.html      pub const fn from_rgb(r: f32, g: f32, b: f32) -> Color { -        Color { r, g, b, a: 1.0 } +        Color::from_rgba(r, g, b, 1.0f32) +    } + +    /// Creates a [`Color`] from its RGBA components. +    /// +    /// [`Color`]: struct.Color.html +    pub const fn from_rgba(r: f32, g: f32, b: f32, a: f32) -> Color { +        Color { r, g, b, a }      }      /// Creates a [`Color`] from its RGB8 components. | 
