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      <const> = privateattributes('colormodel')
local a_color           <const> = privateattributes('color')
local a_transparency    <const> = 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
