~amavect/makeu

ref: b6f6785f804b8f37745fdeff16f2e707c3a25664 makeu/fns.h -rw-r--r-- 624 bytes
b6f6785famavect rename com.h to more standard fns.h 1 year, 3 months ago
                                                                                
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
typedef struct RGBd RGBd;
typedef struct HSVd HSVd;
typedef struct Ratioxy Ratioxy;

struct RGBd{
	double red;
	double green;
	double blue;
};

struct HSVd{
	double hue; /* hue [0,6] */
	double sat; /* saturation [0,1] */
	double val; /* value [0,1] */
};

struct Ratioxy{
	double x;
	double y;
};

/* color funcs */
ulong unsetalpha(ulong);
void colortoarray(uchar col[3], ulong);
RGBd torgbd(RGB);
RGB torgb(RGBd);
RGB colortorgb(ulong);
ulong rgbtocolor(RGB);
RGBd hsvdtorgbd(HSVd);
HSVd rgbdtohsvd(RGBd);
HSVd rgbtohsvd(RGB);
RGB hsvdtorgb(HSVd);

/* misc */
Point ptclip(Point, Rectangle);
ulong strtocolor(char *str);