We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Color
1 parent f2b9d09 commit fdac4c2Copy full SHA for fdac4c2
src/color.rs
@@ -223,6 +223,20 @@ impl Color {
223
a: NV_ONE,
224
};
225
226
+ /// Creates a new color from 4 components.
227
+ ///
228
+ /// # Safety
229
230
+ /// All values must be in 0..=1 range.
231
+ pub const unsafe fn from_rgba_unchecked(r: f32, g: f32, b: f32, a: f32) -> Self {
232
+ Color {
233
+ r: NormalizedF32::new_unchecked(r),
234
+ g: NormalizedF32::new_unchecked(g),
235
+ b: NormalizedF32::new_unchecked(b),
236
+ a: NormalizedF32::new_unchecked(a),
237
+ }
238
239
+
240
/// Creates a new color from 4 components.
241
///
242
/// All values must be in 0..=1 range.
0 commit comments