Files
product-vamp/src/vamp_style.cpp
T
khodowany fe42d811fa
ci / checks (push) Successful in 42m54s
Formatting
2026-09-15 00:06:02 -05:00

12 lines
375 B
C++

#include <vamp_style.hpp>
#include <cstdint>
auto vamp_style::rgb565(vamp_style::color value) -> std::uint16_t {
auto r = static_cast<std::uint16_t>((value.r >> 3U) & 0x1fU);
auto g = static_cast<std::uint16_t>((value.g >> 2U) & 0x3fU);
auto b = static_cast<std::uint16_t>((value.b >> 3U) & 0x1fU);
return static_cast<std::uint16_t>((r << 11U) | (g << 5U) | b);
}