[Gambas-user] RGB components from color

Daniel Campos dcamposf at ...626...
Mon Oct 16 11:19:43 CEST 2006


The Color array syntax is useful only for Gambas 2. If you're using
Gambas 1 you can do it manually, but the depends on the kind of color
encoding you're using (RGB, BGR, RGBA...). If you're using just RGB
and 8 bits per color, you can do:

R=Lsr(hColor, 16) and &HFF

G=Lsr(hColor, 8) AND &HFF

B=hColor AND &HFF

Daniel

2006/10/16, Laurent Carlier <lordheavy at ...512...>:
> Le lundi 16 octobre 2006 10:48, Marco Colnaghi a écrit:
> > I'm using gambas 1.0.15 (Debian Etch).
> >
> > I asked info about getting RGB components from a color (integer)
> >
> > I had and hint, but I still have problems:
> > > > Is there a function giving back the red (or green or blue) component of
> > > > a color? (equivalent to qRed in QT)
> > >
> > > Color[Value].Red
> > > Color[Value].Green
> > > Color[Value].Blue
> >
> > this does not work in my gambas (Error: Color is not an array)
> >
> > Can please someone help me?
> > A simple line of code would be very helpful.
> >
> > Thanks in advance,
> > Marco.
> >
>
> PRINT color[&hFFFFFFFF].Red
>
> -> 255
>
> Regards,
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list