#include "image.h" auto pnm::color_to_hex(pnm::rgb_pixel color) -> std::string { constexpr static char hex[] = "0123456789abcdef"; return {hex[color.red() / 16u], hex[color.red() % 16u], hex[color.green() / 16u], hex[color.green() % 16u], hex[color.blue() / 16u], hex[color.blue() % 16u]}; }