Skip to content

Commit

Permalink
Merge pull request #6 from MotoLegacy/cypress/stbi-support
Browse files Browse the repository at this point in the history
Fix oversight with converting COL_FindColor to BGR
  • Loading branch information
fhomolka authored Aug 27, 2024
2 parents 3322df8 + 2e7fd22 commit d6a6067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions im_color.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ byte COL_FindColor(const byte *palette, u32_t rgb_col)

for (int i = min_col; i <= max_col; i++)
{
int dr = RGB_R(rgb_col) - palette[i*3+0];
int dr = RGB_R(rgb_col) - palette[i*3+2];
int dg = RGB_G(rgb_col) - palette[i*3+1];
int db = RGB_B(rgb_col) - palette[i*3+2];
int db = RGB_B(rgb_col) - palette[i*3+0];

int dist = dr*dr + dg*dg + db*db;

Expand Down

0 comments on commit d6a6067

Please sign in to comment.