#include "assets/fallback_data/fallback_texture.hpp" assets::texture_data assets::generate_fallback_texture( const int width, const int height, const std::span colors ) { const auto pixel_count = width * height; auto data = std::make_unique(pixel_count * sizeof(fallback_color)); auto pixels = reinterpret_cast(data.get()); for (int y{}; y != height; ++y) { for (int x{}; x != width; ++x) { const auto index = (x + y) % colors.size(); *pixels++ = colors[index]; } } return { std::move(data), width, height, fallback_color::components }; }