I guess i could post them here, but i was sure i got the original version from fox page
Code:
Function RGB2DD(R As Byte, g As Byte, b As Byte, surface As DirectDrawSurface7) As Long
    Dim temp As DDPIXELFORMAT
    Dim Red!, Green!, Blue!, Alpha!
    
    'Shift colors
    Red = R / 255
    Green = g / 255
    Blue = b / 255
    Alpha = 1
    'Get the pixel format
    surface.GetPixelFormat temp
    'Return the scaled color
    RGB2DD = (temp.lRGBAlphaBitMask * Alpha And temp.lRGBAlphaBitMask) + (temp.lRBitMask * Red And temp.lRBitMask) + (temp.lGBitMask * Green And temp.lGBitMask) + (temp.lBBitMask * Blue And temp.lBBitMask)
End Function
Function Color2DD(color&, surface As DirectDrawSurface7) As Long
    Dim temp As DDPIXELFORMAT
    Dim Red!, Green!, Blue!, Alpha!
    
    'Shift colors
    Red = color And 255
    Green = color \ 256 And 255
    Blue = color \ 65536 And 255
    Alpha = 1
    'Get the pixel format
    surface.GetPixelFormat temp
    'Return the scaled color
    Color2DD = (temp.lRGBAlphaBitMask * Alpha And temp.lRGBAlphaBitMask) + (temp.lRBitMask * Red And temp.lRBitMask) + (temp.lGBitMask * Green And temp.lGBitMask) + (temp.lBBitMask * Blue And temp.lBBitMask)
End Function