1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -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:
GiGaGon
2024-11-11 04:21:58 -08:00
committed by GitHub
parent 3c7ad0ee12
commit 1787952a83
4 changed files with 7 additions and 0 deletions

View File

@@ -124,6 +124,7 @@ impl ColorImage {
/// Create a [`ColorImage`] from iterator over flat opaque gray data.
///
/// Panics if `size[0] * size[1] != gray_iter.len()`.
#[doc(alias = "from_grey_iter")]
pub fn from_gray_iter(size: [usize; 2], gray_iter: impl Iterator<Item = u8>) -> Self {
let pixels: Vec<_> = gray_iter.map(Color32::from_gray).collect();
assert_eq!(size[0] * size[1], pixels.len());