-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor.h
38 lines (30 loc) · 858 Bytes
/
color.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef ICYLIB_COLOR_H
#define ICYLIB_COLOR_H
#include "icylib.h"
typedef struct icylib_Color {
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
} icylib_Color;
icylib_Color icylib_color_from_rgb(unsigned char r, unsigned char g, unsigned char b);
icylib_Color icylib_color_from_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
#ifdef ICYLIB_IMPLEMENTATION
icylib_Color icylib_color_from_rgb(unsigned char r, unsigned char g, unsigned char b) {
icylib_Color color;
color.r = r;
color.g = g;
color.b = b;
color.a = 255;
return color;
}
icylib_Color icylib_color_from_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
icylib_Color color;
color.r = r;
color.g = g;
color.b = b;
color.a = a;
return color;
}
#endif
#endif