• Welcome to Jose's Read Only Forum 2023.
 

Passing rgb + alpha to 16bit color

Started by Edwin Knoppert, February 16, 2010, 03:05:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Edwin Knoppert

I wonder how i can convert my ordinary rgb() + alpha value to the rgb values suitable for vertex.

The vertex is:

  vertex( 0 ).Red    = &HF500
  vertex( 0 ).Green  = &HF900
  vertex( 0 ).Blue   = &HF500
  vertex( 0 ).Alpha  = &H0000


F5 is the ordinary red value here.
I could use val( &H.. ) i guess but there must be an easier way... (vertex( 0 ).Red    = Val( "&H" & Hex$( 245, 2 ) & "00" ) '&HF500)

In my code i would like to pass a dword with RGB value.

:)