Skip to content

Instantly share code, notes, and snippets.

@DeviousMalcontent
Last active January 27, 2023 03:06
Show Gist options
  • Save DeviousMalcontent/32fbc5c0f8ed2a75f2bb681d790a9f6a to your computer and use it in GitHub Desktop.
Save DeviousMalcontent/32fbc5c0f8ed2a75f2bb681d790a9f6a to your computer and use it in GitHub Desktop.
echo "<!DOCTYPE html><html><head><style>table {font-family: arial, sans-serif;border-collapse: collapse;}td, th {border: 1px solid #00000;text-align: left;padding: 8px;}</style></head><body><table>" | Out-File htmlcolors.html -Append
for($i=0; $i -le 16777215; $i++){
$result = if ($i -le 8388607) {$textColour="FFFFFF"} else {$textColour="000000"}
$HTMLColour = ('{0:X6}' -f $i)
echo "<tr><td style='background-color:#$HTMLColour; color:#$textColour;'>#$HTMLColour</td></tr>" | Out-File htmlcolors.html -Append
}
echo "</table></body></html>" | Out-File htmlcolors.html -Append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment