Page 1 of 1

FWH 8.07 - User defined gradient colors

Posted: Fri Jul 25, 2008 12:08 pm
by Antonio Linares
Gradient colors for Bars, Buttons and XBrowses can be easily defined, and accept an unlimited number of gradient "areas" (not just two). New DATA bClrGrad:
Image

Code: Select all

   DEFINE BUTTONBAR oBar OF oWnd SIZE 60, 60 2007

   oBar:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 0.25, nRGB( 129, 132, 135 ), nRGB( 54, 58, 62 ) },;
                                       { 0.75, nRGB(  20,  40,  60 ), nRGB(  5, 10, 15 ) } },;
                                     { { 0.25, nRGB( 160, 173, 174 ), nRGB( 67, 112, 133 ) },;
                                       { 0.75, nRGB(  11,  66,  94 ), nRGB( 74, 134, 187 ) } } ) }
   oBar:nClrText = { | lInvert | If( ! lInvert, nRGB( 235, 160, 86 ), nRGB( 20, 20, 20 ) ) }                        
You can use many different colors, as the result of evaluating those codeblocks!

Posted: Fri Jul 25, 2008 12:19 pm
by JC
Very nice!

Posted: Fri Jul 25, 2008 12:33 pm
by Antonio Linares
iTunes colors:
Image

Code: Select all

   oBar:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 1, nRGB( 195, 196, 194 ), nRGB( 151, 149, 150 ) } },;
                                     { { 1, nRGB( 254, 255, 232 ), nRGB( 214, 219, 191 ) } } ) }
   oBar:nClrText = { | lInvert | If( ! lInvert, nRGB( 235, 160, 86 ), nRGB( 20, 20, 20 ) ) }                        

Posted: Fri Jul 25, 2008 12:49 pm
by Antonio Linares
Three gradient areas sample. You can use an unlimited number of gradient areas:
Image

Code: Select all

   oBar:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 0.30, nRGB( 0, 228, 1 ), nRGB( 168, 231, 38 ) },;
                                       { 0.30, nRGB( 168, 231, 38 ), nRGB( 233, 175, 5 ) },;
                                       { 0.30, nRGB( 233, 175, 5 ), nRGB( 236, 8, 9 ) } },;
                                     { { 1, nRGB( 254, 255, 232 ), nRGB( 214, 219, 191 ) } } ) }
   oBar:nClrText = nRGB( 255, 0, 255 )

Posted: Fri Jul 25, 2008 1:14 pm
by vilian
Antonio,

And buttonbmp ? when ???

Posted: Fri Jul 25, 2008 1:45 pm
by Antonio Linares
Vilian,

Very soon :-)

Posted: Fri Jul 25, 2008 6:03 pm
by Antonio Linares
iPhone's buttonbar colors:
Image

Code: Select all

   oBar:bClrGrad = { | lInvert | If( ! lInvert,;
                                     { { 0.50, nRGB( 178, 187, 202 ), nRGB( 137, 155, 179 ) },;
                                       { 0.50, nRGB( 129, 149, 174 ), nRGB( 114, 132, 156 ) } },;
                                     { { 0.50, nRGB( 139, 166, 193 ), nRGB(  69, 119, 170 ) },;
                                       { 0.50, nRGB(  52, 104, 152 ), nRGB(  50, 107, 162 ) } } ) }
   oBar:nClrText = nRGB( 255, 255, 255 )

Posted: Fri Aug 29, 2008 11:46 pm
by marca
Ola Antonio

e como fica a msgbar ?
pos

oWnd:oMsgBar:bClrGrad = { | lInvert | If( ! lInvert,;
{ { 0.50, nRGB( 178, 187, 202 ), nRGB( 137, 155, 179 ) } ,;
{ 0.50, nRGB( 129, 149, 174 ), nRGB( 114, 132, 156 ) } },;
{ { 0.50, nRGB( 139, 166, 193 ), nRGB( 69, 119, 170 ) },;
{ 0.50, nRGB( 52, 104, 152 ), nRGB( 50, 107, 162 ) } } ) }
oWnd:oMsgBar:nClrText = { | lInvert | If( ! lInvert, nRGB( 000, 000, 000 ),nRGB( 155, 155, 155 ) )}


nao funcionou


um abraço

Posted: Fri Aug 29, 2008 11:59 pm
by nageswaragunupudi
MsgBar uses bitmaps. Does not use color gradients.

Posted: Sat Aug 30, 2008 12:58 pm
by marca
Poderia dar um exemplo de como fazer com o bitmap ?


obrigado

Posted: Sat Aug 30, 2008 2:51 pm
by marca
Ok ja resolvi o problema

Obrigado