Author Topic: Passing rgb + alpha to 16bit color  (Read 2387 times)

0 Members and 1 Guest are viewing this topic.

Offline Edwin Knoppert

  • Sr. Member
  • ****
  • Posts: 254
  • User-Rate: +11/-4
    • Hellobasic.com
Passing rgb + alpha to 16bit color
« 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:
Code: [Select]
  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.

:)
« Last Edit: February 16, 2010, 03:08:51 PM by Edwin Knoppert »