I guess I did things the "hard" way when I was looking for a method of converting from 24bit colour to 16 colours.... (didn't google, wanted to figure something out on my own)
I found the approximate 24 bit hex values of each colour found in the 4 bit colour palette and then gave each nibble in the 24 bit colour a "score" (for lack of a better term) of either L, D, M, B (Low, Dim, Medium, and Bright).....
So, for example, the colour red is represented as 0xFF0000 in hex, which when scored is BLL, bright yellow would be something like 0xaaaa55 (can't remember the exact value.) which would then be MMD. I did that for all 16 colours.
Then, figuring that there are 64 possible combinations that can be created from L, D, M, B, I created a lookup table that maps each possible combination to the closest matching 4 bit VGA "index" (again, lack of a better term).
With that lookup table, I can then "score" any 24 bit RGB value, look up the score, and get the closest matching VGA colour...
Don't know if that makes much sense
But it works quite well... obviously is just a direct colour mapping, there's no dithering going on at all..... maybe this method has been used before, I dunno, I've still not looked it up