Does anyone have a good heuristic for efficiently converting between 3byte RGB value (ie

Does anyone have a good heuristic for efficiently converting between 3byte RGB value (ie 8 bits per channel) to a 2 byte one (typically 5,6,5 bits for RGB)? I’m trying to fit the values for 16 LEDs into the 42 bytes left of a single 64B network frame and figured I’d check the knowledge here before going with a naive approach such as:

((R >> 3) << 5) | ((G >> 2) << 6) | (B >> 3)