Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
BertranK authored Apr 12, 2024
1 parent c1ad9cd commit b7caf76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h1>IronCAD Catalog Icon Creator ✨</h1>
}

// Set the text color based on the luminance of the background
const bgColor = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
const bgColor = ctx.getImageData(24, 24, 1, 1).data;
const luminance = (0.299 * bgColor[0] + 0.587 * bgColor[1] + 0.114 * bgColor[2]) / 255;
const textColor = luminance > 0.5 ? '#000000' : '#ffffff';
ctx.fillStyle = textColor;
Expand Down

0 comments on commit b7caf76

Please sign in to comment.