Skip to content

Commit

Permalink
Refactor color matching logic in shader generator for accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
humanbydefinition committed Nov 17, 2024
1 parent 4a80364 commit e1e0bc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/p5.asciify.js
Original file line number Diff line number Diff line change
Expand Up @@ -2032,7 +2032,7 @@ void main() {
// Find a matching color slot
bool matched = false;
for(int k = 0; k < NUM_SLOTS; k++) {
if(distance(sampledColor, colors[k]) < 0.001) {
if(sampledColor.rgb == colors[k].rgb) {
counts[k] += 1.0;
matched = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion dist/p5.asciify.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void main() {
// Find a matching color slot
bool matched = false;
for(int k = 0; k < NUM_SLOTS; k++) {
if(distance(sampledColor, colors[k]) < 0.001) {
if(sampledColor.rgb == colors[k].rgb) {
counts[k] += 1.0;
matched = true;
break;
Expand Down

0 comments on commit e1e0bc6

Please sign in to comment.