[Gambas-user] Why &H in color code

Rob sourceforge-raindog2 at ...94...
Tue Jan 6 15:08:23 CET 2004


On Tuesday 06 January 2004 07:50, Pozzo wrote:
> I type it some times when I remember the exact code for some
> colors that is difficult to find in the "..." menu.  I only
> don't understand why gambas doesn't add "&H" and "&" it self

Because you can also enter a decimal number there (and I 
frequently do, e.g. 16777215 for white, 255 for blue, which is 
actually red in VB, 65280 for green, etc.)  

I seem to remember that it's the same in VB, or at least when I 
used to enter decimal numbers it worked fine and I had to prefix 
them with something to get VB to see them as hex.  I guess 
Gambas could special-case color properties in the Properties 
dialog so the default is to treat the value as hex, but really, 
if it's too much trouble to type &HFF0000& for red, perhaps 
you'd be better off using the color picker.

One thing that I do think would be helpful would be a GIMP-like 
text box in the color picker that lets you enter a hex color in 
the style of the web.  Unfortunately (in this case), Gambas uses 
the standard Qt color picker which has no such facility.  Maybe 
with a future Qt release this will be added "for free".

Rob





More information about the User mailing list