I've been trying to create a function for VB.NET, capable of converting Hexadecimal Color to BGR555 format. As far as I've looked, there's only one function that does this on the internet, but it's done in JavaScript (more details: https://orangeglo.github.io/BGR555/)
I even had help from some people in creating the function, but it still didn't turn out as expected. If anyone finds out why the result is different, I would be very grateful.
Practical example: The original function in JavaScript converted the value #FFFFFF to 7FFF (Big Endian). With the function I created together with others, it returns 2048. https://i.stack.imgur.com/R8hSs.png
Not sure why your conversion function converts White (
RGB (255, 255, 255)
) or#FFFFFF
(RGB) to2048
in BGR555.Assuming
2048
is hexadecimal, the bits representation is10000001001000
If it's decimal, the representation is
100000000000
I don't know how you got there, it should be
111111111111111
.BGR555 is defined as
In VB.NET it could be something like this: