mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Create gray -> grey doc aliases (#5362)
As someone who uses "grey" instead of "gray", it is annoying that my autocomplete can never find any of the "gray" color related things, so this adds doc aliases for that. * [x] I have followed the instructions in the PR template
This commit is contained in:
@@ -43,8 +43,11 @@ impl Color32 {
|
||||
|
||||
pub const TRANSPARENT: Self = Self::from_rgba_premultiplied(0, 0, 0, 0);
|
||||
pub const BLACK: Self = Self::from_rgb(0, 0, 0);
|
||||
#[doc(alias = "DARK_GREY")]
|
||||
pub const DARK_GRAY: Self = Self::from_rgb(96, 96, 96);
|
||||
#[doc(alias = "GREY")]
|
||||
pub const GRAY: Self = Self::from_rgb(160, 160, 160);
|
||||
#[doc(alias = "LIGHT_GREY")]
|
||||
pub const LIGHT_GRAY: Self = Self::from_rgb(220, 220, 220);
|
||||
pub const WHITE: Self = Self::from_rgb(255, 255, 255);
|
||||
|
||||
@@ -128,6 +131,7 @@ impl Color32 {
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "from_grey")]
|
||||
#[inline]
|
||||
pub const fn from_gray(l: u8) -> Self {
|
||||
Self([l, l, l, 255])
|
||||
|
||||
@@ -91,6 +91,7 @@ impl Rgba {
|
||||
Self([r, g, b, 1.0])
|
||||
}
|
||||
|
||||
#[doc(alias = "from_grey")]
|
||||
#[inline]
|
||||
pub const fn from_gray(l: f32) -> Self {
|
||||
Self([l, l, l, 1.0])
|
||||
|
||||
Reference in New Issue
Block a user