diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-05-13 23:36:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-05-13 23:36:00 +0200 |
commit | b34cc94e16a5baacd0201e20f190ec224c00f952 (patch) | |
tree | 90c95e14f2a2b099d99e39c31b08529f6e21fdfb /tex/context/base/colo-ini.lua | |
parent | 8c0bb98e13632d6caf24fd08261ff4bca4fdd4eb (diff) | |
download | context-b34cc94e16a5baacd0201e20f190ec224c00f952.tar.gz |
beta 2010.05.13 23:36
Diffstat (limited to 'tex/context/base/colo-ini.lua')
-rw-r--r-- | tex/context/base/colo-ini.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index 363850928..0e73761a3 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -189,19 +189,19 @@ function colors.definesimplegray(name,s) end function colors.defineprocesscolor(name,str,global,freeze) -- still inconsistent color vs transparent - local r = match(str,"^#(.+)$") -- for old times sake (if we need to feed from xml or so) - local t = (r and { h = r }) or settings_to_hash_strict(str) + local x = match(str,"^#(.+)$") -- for old times sake (if we need to feed from xml or so) + local t = (x and { x = x }) or settings_to_hash_strict(str) if t then - if t.v then - local r, g, b = colors.hsvtorgb(tonumber(t.h) or 0, tonumber(t.s) or 1, tonumber(t.v) or 1) -- maybe later native - definecolor(name, register_color(name,'rgb',r,g,b), global) - elseif t.h then - local r, g, b = match(t.h .. "000000","(..)(..)(..)") -- watch the 255 - definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global) - elseif t.r or t.g or t.b then + if t.r or t.g or t.b then definecolor(name, register_color(name,'rgb', tonumber(t.r) or 0, tonumber(t.g) or 0, tonumber(t.b) or 0), global) elseif t.c or t.m or t.y or t.k then definecolor(name, register_color(name,'cmyk',tonumber(t.c) or 0, tonumber(t.m) or 0, tonumber(t.y) or 0, tonumber(t.k) or 0), global) + elseif t.v then + local r, g, b = colors.hsvtorgb(tonumber(t.h) or 0, tonumber(t.s) or 1, tonumber(t.v) or 1) -- maybe later native + definecolor(name, register_color(name,'rgb',r,g,b), global) + elseif t.x or t.h then + local r, g, b = match((t.x or t.h) .. "000000","(..)(..)(..)") -- watch the 255 + definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global) else definecolor(name, register_color(name,'gray',tonumber(t.s) or 0), global) end |