#pragma once /// @file Palette.hpp /// For complete documentation, see src/pixels/Palette.cpp #include #include namespace hdk::sdl { class Palette : public hdk::grid::SharedPtrWrapper { public: friend class Texture; friend class Surface; using hdk::grid::SharedPtrWrapper::SharedPtrWrapper; static Palette Create(int ncolors) { return Palette(get_or_cache(SDL_CreatePalette(ncolors), SDL_DestroyPalette)); } void Destroy() const { SDL_DestroyPalette(*this); } bool SetColors(const SDL_Color* colors, int firstcolor, int ncolors) const { return SDL_SetPaletteColors(*this, colors, firstcolor, ncolors); } }; }