From 722d672f5838fc6799aa5faec0cc9da821750691 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Sat, 8 Jun 2019 12:52:35 -0500 Subject: [PATCH] Update Frame.cpp --- src/Frame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Frame.cpp b/src/Frame.cpp index cacd91d9..aa7c0d87 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -491,9 +491,9 @@ bool Frame::CheckPixel(int row, int col, int red, int green, int blue, int alpha // Check pixel color const unsigned char* pixels = GetPixels(row); if (pixels[col_pos + 0] >= (red - threshold) && pixels[col_pos + 0] <= (red + threshold) && - pixels[col_pos + 0] >= (green - threshold) && pixels[col_pos + 0] <= (green + threshold) && - pixels[col_pos + 0] >= (blue - threshold) && pixels[col_pos + 0] <= (blue + threshold) && - pixels[col_pos + 0] >= (alpha - threshold) && pixels[col_pos + 0] <= (alpha + threshold)) { + pixels[col_pos + 1] >= (green - threshold) && pixels[col_pos + 1] <= (green + threshold) && + pixels[col_pos + 2] >= (blue - threshold) && pixels[col_pos + 2] <= (blue + threshold) && + pixels[col_pos + 3] >= (alpha - threshold) && pixels[col_pos + 3] <= (alpha + threshold)) { // Pixel color matches successfully return true; } else {