libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
color.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5#include <ship/utils/color.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
20typedef union {
21 struct {
22#ifdef IS_BIGENDIAN
23 uint8_t r;
24 uint8_t g;
25 uint8_t b;
26 uint8_t a;
27#else
28 uint8_t a;
29 uint8_t b;
30 uint8_t g;
31 uint8_t r;
32#endif
33 };
34 uint32_t rgba;
36
44typedef struct {
45 float r;
46 float g;
47 float b;
48 float a;
50
59typedef union {
60 struct {
61 uint16_t r : 5;
62 uint16_t g : 5;
63 uint16_t b : 5;
64 uint16_t a : 1;
65 };
66 uint16_t rgba;
68
69#ifdef __cplusplus
70};
71#endif
Single-precision floating-point RGBA colour.
Definition color.h:44
float a
Alpha channel [0.0, 1.0] (0 = transparent, 1 = opaque).
Definition color.h:48
float b
Blue channel [0.0, 1.0].
Definition color.h:47
float r
Red channel [0.0, 1.0].
Definition color.h:45
float g
Green channel [0.0, 1.0].
Definition color.h:46
16-bit RGBA colour using 5-5-5-1 bit packing.
Definition color.h:59
uint16_t g
Green channel (5 bits, range 0–31).
Definition color.h:62
uint16_t a
Alpha channel (1 bit, 0 = transparent, 1 = opaque).
Definition color.h:64
uint16_t r
Red channel (5 bits, range 0–31).
Definition color.h:61
uint16_t rgba
All four channels packed into a single 16-bit integer.
Definition color.h:66
uint16_t b
Blue channel (5 bits, range 0–31).
Definition color.h:63
32-bit RGBA colour stored in a union that allows component and packed-integer access.
Definition color.h:20
uint8_t a
Alpha channel (little-endian layout — lowest address byte).
Definition color.h:28
uint32_t rgba
All four channels packed into a single 32-bit integer.
Definition color.h:34
uint8_t b
Blue channel (little-endian layout).
Definition color.h:29
uint8_t r
Red channel (little-endian layout — highest address byte).
Definition color.h:31
uint8_t g
Green channel (little-endian layout).
Definition color.h:30