Sometimes when I’m doing web programming (namely CSS), I need to quickly convert RGB to HEX. So, I have written a neat little Powershell script. Keep in mind that you might have to enable the ability to run Powershell scripts on your system (if you haven’t already, there are plenty of sites out there that show how to do this). You should save this script as RGB2HEX.ps1
foreach ($arg in $args)
$hexval = $hexval + [Convert]::ToString($arg, 16).ToUpper()
Write-Host "Hex value :: $hexval"
To run this on the Powershell Console, do the following (in this case I’m testing converting 255 255 255 to hex)
.RGB2HEX.ps1 255 255 255