Your interpolation looks correct, but I think you can simplify it.
c1 + ((c2 - c1) * K#)
I'd say create several functions to handle each format.
function blend()
peekGreen = foobar
if peekGreen = 0x07e0 then exitfunction blend565()
if peekGreen = 0x03e0 then exitfunction blend555()
if peekGreen = 0x00f0 then exitfunction blend444()
endfunction
function blend565()
function blend555()
function blend444()
Although, since you're pulling the pixel information from a memblock, I think its safe to assume that DB already handles the format and I believe it's ARRRRRGGGGGBBBBB.
pixel as word
pixel = memblock word(1,location of pixel data)
print "Alpha: ",(pixel && %1000000000000000) >> 15
print "Red: ",(pixel && %0111110000000000) >> 10
print "Green: ",(pixel && %0000001111100000) >> 5
print "Blue: ",(pixel && %0000000000011111)
Edit:
@Latch, did you remove a post? I tried to answer your questions and when I finally posted, your questions are nowhere to be found.