From 69d572dd8145a84db571f65183d8ccb54fdaab69 Mon Sep 17 00:00:00 2001 From: Thuc Chi Do Date: Mon, 11 Aug 2025 04:33:14 -0400 Subject: [PATCH] getcolor --- source/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/main.c b/source/main.c index 4057359..21028b8 100644 --- a/source/main.c +++ b/source/main.c @@ -27,6 +27,15 @@ void flushBuffs(u8 *buf) { buf = malloc(BUFSIZE); } +void getColor(void *fb, int row, int col) { + u8 *fb_8 = (u8*) fb; + u32 v = ((HEIGHT - col) + (row*HEIGHT)) * 3; + uint8_t r = fb_8[v]; + uint8_t g = fb_8[v+1]; + uint8_t b = fb_8[v+2]; + printf("\n---RGB2---%u %u %u\n", r, g, b); +} + int main(int argc, char* argv[]) { u8 *buf = malloc(BUFSIZE);