@brief Convert RGB to LPD6803 16-bit format (1bbbbbgggggrrrrr) @param r Red component (0-255) @param g Green component (0-255) @param b Blue component (0-255) @return 16-bit LPD6803 command word @note Bit 15: marker (1), Bits 14-0: 5-5-5 RGB
| 100 | /// @return 16-bit LPD6803 command word |
| 101 | /// @note Bit 15: marker (1), Bits 14-0: 5-5-5 RGB |
| 102 | inline u16 lpd6803EncodeRGB(u8 r, u8 g, u8 b) FL_NOEXCEPT { |
| 103 | u16 command = 0x8000; // Start marker |
| 104 | command |= (r & 0xF8) << 7; // Red: high 5 bits |
| 105 | command |= (g & 0xF8) << 2; // Green: high 5 bits |
| 106 | command |= (b >> 3); // Blue: high 5 bits |
| 107 | return command; |
| 108 | } |
| 109 | |
| 110 | } // namespace fl |
no outgoing calls
no test coverage detected