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
|
if not modules then modules = { } end modules ['node-tra'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
local nuts = nodes.nuts
local setattrs = nuts.setattrs
local privateattributes = attributes.private
local a_colormodel = privateattributes('colormodel')
local a_color = privateattributes('color')
local a_transparency = privateattributes('transparency')
local colors = { }
nuts.colors = colors
function colors.set(n,ma,ca,ta) -- we could also do layers here
if ca then
if ca > 0 then
if not ma or ma == 0 then
ma = 1
end
if ta then
setattrs(n,a_colormodel,ma,a_color,ca,a_transparency,ta)
else
setattrs(n,a_colormodel,ma,a_color,ca)
end
end
elseif ta then
if ta > 0 then
setattr(n,a_transparency,ta)
end
end
return n
end
|