代码拉取完成,页面将自动刷新
#ifndef __TINYCOLOR_H__
#define __TINYCOLOR_H__
#include <stdint.h>
#ifndef COLOR_WITH_ALPHA
#warning "the color data struct will not contain alpha channel"
#endif
#define COLOR_SPACE_RGB 0
#define COLOR_SPACE_CMY 1
#define COLOR_SPACE_CMYK 2
#define COLOR_SPACE_GRAY 3
#define COLOR_SPACE_HSI 4
#define COLOR_SPACE_HSL 5
#define COLOR_SPACE_HSV 6
#define COLOR_SPACE_HWB 7
#define COLOR_SPACE_Lab 8
#define COLOR_SPACE_LabCH 9
#define COLOR_SPACE_LMS 10
#define COLOR_SPACE_Luv 11
#define COLOR_SPACE_LuvCH 12
#define COLOR_SPACE_TSL 13
#define COLOR_SPACE_XYY 14
#define COLOR_SPACE_XYZ 15
#define COLOR_SPACE_YCgCo 16
#define COLOR_SPACE_YDbDr 17
#define COLOR_SPACE_YIQ 18
#define COLOR_SPACE_YPdPr 19
#define COLOR_SPACE_YUV 20
typedef struct _tinyColor tinyColor;
#define COLOR_CONVERT_(from, to) \
extern int color_convert_##from##_##to(tinyColor *color); \
extern int color_convert_##to##_##from(tinyColor *color);
COLOR_CONVERT_(RGB, CMYK)
COLOR_CONVERT_(RGB, GRAY)
COLOR_CONVERT_(RGB, HSI)
COLOR_CONVERT_(RGB, HSL)
COLOR_CONVERT_(RGB, HSV)
COLOR_CONVERT_(RGB, HWB)
COLOR_CONVERT_(RGB, Lab)
COLOR_CONVERT_(RGB, LabCH)
COLOR_CONVERT_(RGB, LMS)
COLOR_CONVERT_(RGB, Luv)
COLOR_CONVERT_(RGB, LuvCH)
COLOR_CONVERT_(RGB, TSL)
COLOR_CONVERT_(RGB, XYY)
COLOR_CONVERT_(RGB, XYZ)
COLOR_CONVERT_(RGB, YCgCo)
COLOR_CONVERT_(RGB, YDbDr)
COLOR_CONVERT_(RGB, YIQ)
COLOR_CONVERT_(RGB, YPdPr)
COLOR_CONVERT_(RGB, YUV)
#define COLOR_JOIN(a, b) a##b
#define COLOR_GLUE(a, b) COLOR_JOIN(a, b)
#define COLOR_SUFFIX(a) COLOR_GLUE(a, COLOR_COMPONENT_WIDTH)
#define COLOR_CATEGORY_PACK(n) COLOR_COMPONENT_TYPE n;
#define COLOR_CATEGORY_PACK_3(n1, n2, n3) \
typedef struct { \
COLOR_CATEGORY_PACK(A) \
COLOR_CATEGORY_PACK(n1) \
COLOR_CATEGORY_PACK(n2) \
COLOR_CATEGORY_PACK(n3) \
} COLOR_SUFFIX(color##n1##n2##n3##_); \
extern int COLOR_SUFFIX(color_component##n1##n2##n3##_)( \
tinyColor * color, COLOR_SUFFIX(color##n1##n2##n3##_) * data); \
extern tinyColor *COLOR_SUFFIX(color_createFrom##n1##n2##n3##_)( \
const COLOR_SUFFIX(color##n1##n2##n3##_) data);
#define COLOR_CATEGORY_PACK_4(n1, n2, n3, n4) \
typedef struct { \
COLOR_CATEGORY_PACK(A) \
COLOR_CATEGORY_PACK(n1) \
COLOR_CATEGORY_PACK(n2) \
COLOR_CATEGORY_PACK(n3) \
COLOR_CATEGORY_PACK(n4) \
} COLOR_SUFFIX(color##n1##n2##n3##n4_);
#define GEN_COLOR_STRUCT \
COLOR_CATEGORY_PACK_3(R, G, B) \
COLOR_CATEGORY_PACK_3(H, S, L)
#define COLOR_COMPONENT_WIDTH 8
#define COLOR_COMPONENT_TYPE int8_t
GEN_COLOR_STRUCT
#undef COLOR_COMPONENT_TYPE
#undef COLOR_COMPONENT_WIDTH
#define COLOR_COMPONENT_WIDTH 16
#define COLOR_COMPONENT_TYPE int16_t
GEN_COLOR_STRUCT
#undef COLOR_COMPONENT_TYPE
#undef COLOR_COMPONENT_WIDTH
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。