UNPKG

449 Btext/x-cView Raw
1// Copyright (c) 2010 LearnBoost <tj@learnboost.com>
2
3#pragma once
4
5#include <stdint.h> // node < 7 uses libstdc++ on macOS which lacks complete c++11
6#include <cstdlib>
7
8/*
9 * RGBA struct.
10 */
11
12typedef struct {
13 double r, g, b, a;
14} rgba_t;
15
16/*
17 * Prototypes.
18 */
19
20rgba_t
21rgba_create(uint32_t rgba);
22
23int32_t
24rgba_from_string(const char *str, short *ok);
25
26void
27rgba_to_string(rgba_t rgba, char *buf, size_t len);
28
29void
30rgba_inspect(int32_t rgba);