Page 1 of 1

How to define xBrowse-textcolor on diff. Backgrounds ?

PostPosted: Fri Jun 17, 2011 7:04 pm
by ukoenig
Hello,

I have a problem, to define the xBrowse-textcolor on different Backgrounds.
I tested many dfferent Settings, but doesn't work.
It seems, the needed Color is detected from Background.
Is it possible to define the Main-texcolor like Ligthblue ( same Color like Title )instead of White ?
I tested the different Solutions :

Image

nFColor = Title-textcolor

WITH OBJECT oBrw1
:nStretchCol := 1
:nMarqueeStyle := 4
:bClrSelFocus := { || { nFColor, aSelGrad } }
:bClrRowFocus := { || { nFColor, aRowGrad } }
:bClrSel = { || { nFColor, aRowGrad } }

// :bClrSel = { || { 0, aRowGrad } }

// :bClrSelFocus = { || { nFColor, } }
// :bClrSel = { || { nFColor, } }
// :bRowFocus = { || { nFColor, 16777215 } }
:SetColor( nFColor, )
END



Best Regards
Uwe :?:

Re: How to define xBrowse-textcolor on diff. Backgrounds ?

PostPosted: Sat Jun 18, 2011 3:15 am
by nageswaragunupudi
By default, XBrowse uses ContrastColor to paint text, when pictures are gradients are used as background. This is intended to ensure that text is visible in each cell whether the background in that cell is dark or light. This contrast color is derived from the background color of the cell.

This behavior can be disabled by setting oBrw:lContrastClr := .f. In such a case the text color used in bClrStd is used whether or not the color is visible over the background.

Re: How to define xBrowse-textcolor on diff. Backgrounds ?

PostPosted: Sat Jun 18, 2011 7:52 am
by ukoenig
Mr. Rao,

thank You very much.

The Option is added :

Image

Best Regards
Uwe :lol:

Re: How to define xBrowse-textcolor on diff. Backgrounds ?

PostPosted: Tue Jun 21, 2011 7:26 pm
by ukoenig
I don't know why, but sometimes I don't get the expexted Results with :
oBrw:lContrastClr := .T.

The Browser on Main-screen :
because Gradient-color white is centered, the Text-color on Bottom Row must be white as well.
The last right Cell-textcolor is black with the same Background-color from the Cell before.

Image

The same Browser zoomed to double Size with different Results :
Because the Background-color of Row 2 is the same for Cell 2, there is no Reason, to show the Text in black.
Texdtcolor White on Browser-bottom is missing.

Image

Maybe a GRADIENT-problem ? Image seems to be OK.

Image

Another Problem : changing the cell-focus :

Image

Maybe a Color-problem ? This Color-sample works fine.

Image

Best Regards
Uwe :?:

Re: How to define xBrowse-textcolor on diff. Backgrounds ?

PostPosted: Wed Jun 22, 2011 3:50 am
by nageswaragunupudi
Mr. Uwe

This is the logic adopted inside XBrowse. The luminance of the center line of each cell is calculated and if it exceeds a particular limit, black color is chosen and otherwise white color is chosen. The luminance may vary between adjacent cells even in a single row when image backgrounds are used. The results may not always be exact, but in a majority of cases, visiblity of text on any background is ensured. This logic is used only when gradient or image backgrounds are chosen. In all other cases, the programmer specified color is used.