-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathColor.cpp
More file actions
53 lines (44 loc) · 664 Bytes
/
Color.cpp
File metadata and controls
53 lines (44 loc) · 664 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "colorTools.h"
Color::Color()
{
argb = { 0 };
balance = 0;
}
void Color::SetARGB(int4 argb_)
{
argb = argb_;
}
int4 Color::GetARGB()
{
return argb;
}
void Color::SetAHSV(int4 ahsv)
{
argb = ARGBfromAHSV(ahsv);
}
int4 Color::GetAHSV()
{
return AHSVfromARGB(argb);
}
void Color::SetMerged(int merged)
{
argb.w = (merged >> 24) & 0xFF;
argb.x = (merged >> 16) & 0xFF;
argb.y = (merged >> 8) & 0xFF;
argb.z = merged & 0xFF;
}
int Color::GetMerged()
{
return (argb.w << 24) |
(argb.x << 16) |
(argb.y << 8) |
argb.z;
}
void Color::SetBalance(int balanceIn)
{
balance = balanceIn;
}
int Color::GetBalance()
{
return balance;
}