opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
color32.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <bit>
7#include <concepts>
8#include <cstdint>
9
10namespace osc
11{
13
14 template<std::integral T>
15 constexpr T to_integer(const Color32& color32)
16 {
17 return std::bit_cast<T>(color32);
18 }
19}
20
21// specialized hashing function for `Color32`
22template<>
23struct std::hash<osc::Color32> final {
24 size_t operator()(const osc::Color32& color32) const noexcept
25 {
26 return std::hash<uint32_t>{}(std::bit_cast<uint32_t>(color32));
27 }
28};
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56
constexpr T to_integer(const Color32 &color32)
Definition color32.h:15
Definition rgba.h:20
size_t operator()(const osc::Color32 &color32) const noexcept
Definition color32.h:24