1#ifndef YAZE_APP_GFX_SNES_COLOR_H_
2#define YAZE_APP_GFX_SNES_COLOR_H_
9#include "imgui/imgui.h"
58 return ImVec4(color.
red / 255.0f, color.
green / 255.0f,
59 color.
blue / 255.0f, 1.0f);
69 result.
red =
static_cast<uint16_t
>(color.x * 255.0f);
70 result.
green =
static_cast<uint16_t
>(color.y * 255.0f);
71 result.
blue =
static_cast<uint16_t
>(color.z * 255.0f);
85std::vector<snes_color> Extract(
const char* data,
unsigned int offset,
86 unsigned int palette_size);
88std::vector<char>
Convert(
const std::vector<snes_color>& palette);
126 color.
red =
static_cast<uint16_t
>(
rgb_.x);
127 color.
green =
static_cast<uint16_t
>(
rgb_.y);
128 color.
blue =
static_cast<uint16_t
>(
rgb_.z);
170 void set_rgb(
const ImVec4 val);
constexpr snes_color rom_color() const
Get snes_color struct (0-255 RGB)
constexpr void set_modified(bool m)
constexpr ImVec4 rgb() const
Get RGB values (WARNING: stored as 0-255 in ImVec4)
constexpr bool is_transparent() const
SnesColor(const ImVec4 val)
Construct from ImVec4 (0.0-1.0 range)
constexpr bool is_modified() const
SnesColor(const snes_color val)
Construct from snes_color struct (0-255 range)
SnesColor(uint8_t r, uint8_t g, uint8_t b)
Construct from RGB byte values (0-255)
SnesColor(const uint16_t val)
Construct from SNES 15-bit color.
constexpr void set_transparent(bool t)
void set_snes(uint16_t val)
Set color from SNES 15-bit format.
constexpr uint16_t snes() const
Get SNES 15-bit color.
void set_rgb(const ImVec4 val)
Set color from ImVec4 (0.0-1.0 range)
snes_color ConvertSnesToRgb(uint16_t color_snes)
Convert SNES 15-bit color to RGB (0-255 range)
ImVec4 SnesColorToImVec4(const snes_color &color)
Convert snes_color (0-255) to ImVec4 (0.0-1.0)
uint16_t ConvertRgbToSnes(const snes_color &color)
Convert RGB (0-255) to SNES 15-bit color.
std::vector< char > Convert(const std::vector< snes_color > &palette)
snes_color ImVec4ToSnesColor(const ImVec4 &color)
Convert ImVec4 (0.0-1.0) to snes_color (0-255)
SnesColor ReadColorFromRom(int offset, const uint8_t *rom)
ImVec4 SnesTo8bppColor(uint16_t color_value)
Convert SNES 15-bit color directly to ImVec4 (0.0-1.0)
constexpr int NumberOfColors
constexpr float kColorByteMaxF
constexpr uint8_t kColorByteMax
SnesColor GetCgxColor(uint16_t color)
std::vector< SnesColor > GetColFileData(uint8_t *data)
Main namespace for the application.
SNES color in 15-bit RGB format (BGR555)
Yet Another Zelda3 Editor (YAZE) - Public C API.