Revert from_rgb to const

This commit is contained in:
Clark Moody 2020-03-31 16:09:06 -05:00
parent 4009f0cf73
commit bb44398819

View File

@ -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.