-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
GDIPAPIExtra.pas
36 lines (30 loc) · 876 Bytes
/
GDIPAPIExtra.pas
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
unit GDIPAPIExtra;
interface
uses GDIPAPI;
{ Color functions }
function ARGBMake(const R,G,B : byte) : ARGB; overload;
function ARGBMake(const A,R,G,B : byte) : ARGB; overload;
implementation
// -----------------------------------------------------------------------------
// Color class
// -----------------------------------------------------------------------------
{ ARGB functions }
function ARGBMake(const R,G,B : byte) : ARGB; overload;
begin
result := ARGB(
ALPHA_MASK or
(R shl RED_SHIFT) or
(G shl GREEN_SHIFT) or
(B shl BLUE_SHIFT)
);
end;
function ARGBMake(const A,R,G,B : byte) : ARGB; overload;
begin
result := ARGB(
(A shl ALPHA_SHIFT) or
(R shl RED_SHIFT) or
(G shl GREEN_SHIFT) or
(B shl BLUE_SHIFT)
);
end;
end.