We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1695a8 commit 76169e7Copy full SHA for 76169e7
1 file changed
raylib/src/core/texture.rs
@@ -85,6 +85,14 @@ impl Image {
85
self.0.data
86
}
87
88
+ pub fn get_pixel(&self, x: i32, y: i32) -> Option<Color> {
89
+ if x < 0 || y < 0 || x >= self.width() || y >= self.height() {
90
+ None
91
+ } else {
92
+ unsafe { Some(ffi::GetImageColor(self.0, x, y)) }
93
+ }
94
95
+
96
#[inline]
97
pub fn format(&self) -> PixelFormat {
98
let i: u32 = self.0.format as u32;
0 commit comments