home *** CD-ROM | disk | FTP | other *** search
- *********************
-
- FUNCTION Whatcolor
-
- PARAMETERS _thecolor
-
- IF EMPTY(PCOUNT())
- RETURN(SETCOLOR())
- ELSE
- IF TYPE("_thecolor")$"DL"
- RETURN(SETCOLOR())
- ENDIF
- ENDIF
-
- PRIVATE _thereturn, _blink, _bright
-
- _bright = .F.
- _blink = .F.
-
- IF TYPE("_thecolor") = "C"
- _thecolor = UPPER(_thecolor)
- ENDIF
-
- IF ISCOLOR() .AND. !(IF(TYPE("scrmono")="U", .T., scrmono))
- IF TYPE("_thecolor") = "C"
- _bright = ("+"$_thecolor)
- _blink = ("*"$_thecolor)
- IF "0" $ _thecolor
- _thereturn = "N"
- ELSEIF "1" $ _thecolor
- _thereturn = "B"
- ELSEIF "2" $ _thecolor
- _thereturn = "G"
- ELSEIF "3" $ _thecolor
- _thereturn = "BG"
- ELSEIF "4" $ _thecolor
- _thereturn = "R"
- ELSEIF "5" $ _thecolor
- _thereturn = "RB"
- ELSEIF "6" $ _thecolor
- _thereturn = "GR"
- ELSEIF "7" $ _thecolor
- _thereturn = "W"
- ELSEIF "8" $ _thecolor
- _thereturn = "W+"
- ELSEIF "9" $ _thecolor
- _thereturn = "GR+"
- ELSEIF "N" = _thecolor
- _thereturn = "N"
- ELSEIF "B" = _thecolor
- _thereturn = "B"
- ELSEIF "G" = _thecolor
- _thereturn = "G"
- ELSEIF "BG" = _thecolor
- _thereturn = "BG"
- ELSEIF "R" = _thecolor
- _thereturn = "R"
- ELSEIF "RB" = _thecolor
- _thereturn = "RB"
- ELSEIF "GR" = _thecolor
- _thereturn = "GR"
- ELSEIF "W" = _thecolor
- _thereturn = "W"
- ELSEIF "U" = _thecolor
- _thereturn = "U"
- ELSEIF "I" = _thecolor
- _thereturn = "I"
- ELSEIF "X" = _thecolor
- _thereturn = "X"
- ELSEIF "N+" = _thecolor
- _thereturn = "N+"
- ELSEIF "GR+" = _thecolor
- _thereturn = "GR+"
- ELSEIF _thecolor == "BOLD"
- _thereturn = SETCOLOR()
- _bright = .T.
- ELSEIF _thecolor == "BLINK"
- _thereturn = SETCOLOR()
- _blink = .T.
- ELSEIF _thecolor == "DULL"
- _thereturn = STRTRAN(SETCOLOR(), "+", "")
- ELSEIF _thecolor $ "RED"
- _thereturn = "R"
- ELSEIF _thecolor $ "GREEN"
- _thereturn = "G"
- ELSEIF _thecolor $ "CYAN"
- _thereturn = "BG"
- ELSEIF _thecolor $ "MAGENTA"
- _thereturn = "RB"
- ELSEIF _thecolor $ "BROWN"
- _thereturn = "GR"
- ELSEIF _thecolor $ "WHITE"
- _thereturn = "W"
- ELSEIF _thecolor $ "BLACK"
- _thereturn = "N"
- ELSEIF _thecolor $ "YELLOW"
- _thereturn = "G+"
- ELSEIF _thecolor $ "GREY"
- _thereturn = "N+"
- ELSEIF _thecolor $ "BLUE"
- _thereturn = "B"
- ELSE
- _thereturn = _thecolor
- ENDIF
- IF "/"$_thereturn
- IF _bright
- _thereturn = STRTRAN(_thereturn, "/", "+/")
- ENDIF
- IF _blink
- _thereturn = STRTRAN(_thereturn, "/", "*/")
- ENDIF
- ELSE
- IF _bright
- _thereturn = _thereturn + "+"
- ENDIF
- IF _blink
- _thereturn = _thereturn + "*"
- ENDIF
- ENDIF
- _thereturn = STRTRAN(_thereturn, "++", "+")
- ELSE
- _thereturn = TRIM(SUBSTR("R G BGRBGRW N B ", (_thecolor * 2) - 1, 2))
- ENDIF
- ELSE
- _thereturn = "W"
- ENDIF
- RETURN(_thereturn)
-
- * End of File
-