| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Extracts a color value from a color string.
GetClrPair( <cColorString>, <nPos> ) --> cColorValue
The function returns the color value at position <nPos> in the passed color string as a character string. If <cColorString> has less than <nPos> colors, the return value is a null string ("").
| See also: | GetPairLen(), GetPairPos(), SetClrPair(), SetColor() |
| Category: | Screen functions |
| Source: | rtl\color53.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example extracts all color values from a color
// string holding eight color values.
PROCEDURE Main
LOCAL i, cColor := "W/R,W/G,W/B,W+/R,W+/G,W+/B,W/BG,W+/BG"
FOR i:=1 TO 8
? GetClrPair( cColor, i )
NEXT
** output
// W/R
// W/G
// W/B
// W+/R
// W+/G
// W+/B
// W/BG
// W+/BG
RETURN
http://www.xHarbour.com