How to define xBrowse-textcolor on diff. Backgrounds ?

How to define xBrowse-textcolor on diff. Backgrounds ?

Postby ukoenig » Fri Jun 17, 2011 7:04 pm

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 :?:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby nageswaragunupudi » Sat Jun 18, 2011 3:15 am

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby ukoenig » Sat Jun 18, 2011 7:52 am

Mr. Rao,

thank You very much.

The Option is added :

Image

Best Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby ukoenig » Tue Jun 21, 2011 7:26 pm

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 :?:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

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

Postby nageswaragunupudi » Wed Jun 22, 2011 3:50 am

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Otto and 84 guests