Jose's Read Only Forum 2023

General Category => General Discussion => Topic started by: Edwin Knoppert on February 16, 2010, 03:05:47 PM

Title: Passing rgb + alpha to 16bit color
Post by: Edwin Knoppert on February 16, 2010, 03:05:47 PM
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.

:)