November 2018
Intermediate to advanced
566 pages
17h 15m
English
We will assume that the input is going to be with or without the # (as in 55bc9a or #55bc9a):
$Rgb = Read-Host "Enter the hexadecimal RGB value"
$TrimmedRgb = $Rgb.Substring($Rgb.Length - 6)
$R = $TrimmedRgb.Substring(0, 2)
$G = $TrimmedRgb.Substring(2, 2)
$B = $TrimmedRgb.Substring(4, 2)
"Here are the R, G and B levels for the supplied hex value:"
$R, $G, $B | ForEach-Object { [int]("0x" + $PSItem) }
Here is an example:

Read now
Unlock full access