Hello,
looking for a solution, to show a font with a selected color on a contrast-background,
I used with a little change the Contrast-function from xBrowse.
Using different Fontcolors on Say on Get, the needed Background is automatically selected,
to show a visible text.
Because of fontcolor < RED >, the Say-background-color changed to white :

Sample :
Best Regards
Uwe
looking for a solution, to show a font with a selected color on a contrast-background,
I used with a little change the Contrast-function from xBrowse.
Using different Fontcolors on Say on Get, the needed Background is automatically selected,
to show a visible text.
Because of fontcolor < RED >, the Say-background-color changed to white :

Sample :
...
...
REDEFINE SAY oTime PROMPT cTime ID 510 OF oDlg2 UPDATE
oTime:SetColor( nTimeColor, GET_CONTR(nTimeColor))
oTime:SetFont( oTimeFont )
REDEFINE BTNBMP oBtn1 OF oDlg2 ;
ID 130 Â PIXEL 2007 ;
NOBORDER ;
PROMPT "&Time-color" ;
FILENAME c_path + "\Images\Select.Bmp" ;
ACTION ( nTimeColor := ChooseColor(), ;
     oTime:SetColor( nTimeColor, GET_CONTR(nTimeColor) ), ;
     oTime:Refresh ) ;
FONT oBrwFont  ;
LEFT
oBtn1:lTransparent := .t. Â
oBtn1:cToolTip = Â { "Time-" + CRLF + "Color","Color-Selection", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )
...
...
// ------------------
FUNCTION GET_CONTR(nFontClr)
LOCAL nClr, nLuma, nContrast
nContrast  := nFontClr
// Fontcolor
nLuma := ( 0.299 * nRGBRed( nFontClr ) + 0.587 * nRGBGreen( nFontClr ) + 0.114 * nRGBBlue( nFontClr ) )
nContrast  := IF( nLuma < 150, CLR_WHITE, CLR_BLACK )
RETURN nContrastBest Regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.