rsegal
15th July 2004 17:46 UTC
Hex codes for common colors
Some common colors I make use of in my installer. It just makes working with colors alot easier.
!define WHITE "FFFFFF"
!define BLACK "000000"
!define YELLOW "FFFF00"
!define RED "FF0000"
!define GREEN "00FF00"
!define BLUE "0000FF"
!define PURPLE "FF00FF"
Visually it makes more sense to see this...
SetCtlColors $R1 ${BLACK} ${YELLOW}
rather than this...
SetCtlColors $R1 000000 FFFF00
Any chance of this getting added to a common NSIS header file?
kichik
15th July 2004 18:41 UTC
Uploaded Colors.nsh.
zimsms
15th July 2004 19:02 UTC
You can find a complete list of the True Color Hex Values here. This should probably be stripped, each given a name and added into colors.nsh. Just to be complete :D
rsegal
15th July 2004 19:08 UTC
Awesome. Thanks kichik for uploading the file and thanks zimsms for the link.
Yathosho
16th July 2004 00:28 UTC
"FF00FF" is actually MAGENTA, and while you're at it, you should add "00FFFF" for CYAN aswell. then you have all base-colors for RGB and CMY, plus black and white.
Joel
16th July 2004 18:30 UTC
I made this macro for convert RGB values into web Hex, hope it helps in something:
# macro function:
!macro rgb2hex R G B
Exch $0
IntFmt $1 "%02X" ${R} # $1 have the Hex value of "R"
IntFmt $2 "%02X" ${G} # $2 have the Hex value of "G"
IntFmt $3 "%02X" ${B} # $3 have the Hex value of "B"
StrCpy $0 "$1$2$3"
Push $0
!macroend
# example:
Push $0 # output var for the hex.
!insertmacro rgb2hex 0 255 255
Pop $0
DetailPrint $0 # display it
kichik
24th July 2004 13:32 UTC
!macro rgb2hex output R G B
IntFmt "${output}" "%02X" "${R}"
IntFmt "${output}" "${output}%02X" "${G}"
IntFmt "${output}" "${output}%02X" "${B}"
!macroend
Joel
24th July 2004 15:28 UTC
That can work kichik :D