Created
April 28, 2025 18:17
-
-
Save alexalannunes/5f1087206dabb0caffe2b7b56749c553 to your computer and use it in GitHub Desktop.
generate light colors for background color values in comparative numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function generateLightColor(): string { | |
// Generate random RGB values for light colors | |
const red = Math.floor(150 + Math.random() * 105); // Range: 150-255 | |
const green = Math.floor(150 + Math.random() * 105); // Range: 150-255 | |
const blue = Math.floor(150 + Math.random() * 105); // Range: 150-255 | |
// Convert RGB to hex | |
return `#${((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1)}`; | |
} |
Author
alexalannunes
commented
Apr 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment