| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Converts a numeric color attribute to a color string.
NtoColor( <nColor> , [<lAsChar>]) --> cColor
The function returns a color string encoding forground and background color as characters or digits.
| See also: | ColorToN() |
| Category: | CT:Video , Screen functions |
| Source: | ct\color.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays all 256 colors.
PROCEDURE Main
LOCAL nRow, nCol, nColor, cColor
nRow := 0
nCol := 0
FOR nColor := 0 TO 255
cColor := NtoColor( nColor, .T. )
@ nRow, nCol SAY PadC( cColor, 8 ) COLOR (cColor)
IF ++nRow > MaxRow()
nRow := 0
nCol += 8
ENDIF
NEXT
RETURN
http://www.xHarbour.com