c-color-names v0.1.0-alpha.1
Color Names API in C
Loading...
Searching...
No Matches
color_names.h
Go to the documentation of this file.
1/*
2
3############### c-color-names License
4
5MIT License
6
7Copyright (c) 2022 Abhishek Mishra <https://github.com/abhishekmishra>
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in all
17copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25SOFTWARE.
26
27############### color-names License
28
29MIT License
30
31Copyright (c) 2017 David Aerne
32
33Permission is hereby granted, free of charge, to any person obtaining a copy
34of this software and associated documentation files (the "Software"), to deal
35in the Software without restriction, including without limitation the rights
36to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37copies of the Software, and to permit persons to whom the Software is
38furnished to do so, subject to the following conditions:
39
40The above copyright notice and this permission notice shall be included in all
41copies or substantial portions of the Software.
42
43THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49SOFTWARE.
50
51*/
52
58#ifndef __COLOR_NAMES_H__
59#define __COLOR_NAMES_H__
60
61#include <stdint.h>
62
63#ifdef __cplusplus
64extern "C"
65{
66#endif
67
75int color_name_exists(const char *color_name);
76
85int color_name_get_rgb_string(const char *color_name, char *color_hex_str);
86
96int color_name_get_rgb(const char *color_name, uint8_t *r, uint8_t *g,
97 uint8_t *b);
98
108const char* color_name_find_rgb(uint8_t r, uint8_t g, uint8_t b);
109
119int color_name_get_hsv(const char *color_name, float *h, float *s,
120 float *v);
121
131const char* color_name_find_hsv(float h, float s, float v);
132
141const char* color_name_find_hex(const char* hex);
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif //__COLOR_NAMES_H__
int color_name_get_rgb_string(const char *color_name, char *color_hex_str)
const char * color_name_find_hex(const char *hex)
int color_name_get_hsv(const char *color_name, float *h, float *s, float *v)
const char * color_name_find_rgb(uint8_t r, uint8_t g, uint8_t b)
int color_name_exists(const char *color_name)
int color_name_get_rgb(const char *color_name, uint8_t *r, uint8_t *g, uint8_t *b)
const char * color_name_find_hsv(float h, float s, float v)