diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-06-05 23:04:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-06-05 23:04:00 +0200 |
commit | 1b8d827a6d33b746d004ac5cfab16de8840054e9 (patch) | |
tree | 9f9c49a37d2d1eb913d17dac51247cdfc296b2e7 /tex/context/base/colo-ini.mkiv | |
parent | ca16b82275f15170ca269f77b9dd9b0e29bbd7f6 (diff) | |
download | context-1b8d827a6d33b746d004ac5cfab16de8840054e9.tar.gz |
beta 2014.06.05 23:04
Diffstat (limited to 'tex/context/base/colo-ini.mkiv')
-rw-r--r-- | tex/context/base/colo-ini.mkiv | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 6aa51b218..98ba2904c 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -688,21 +688,39 @@ \attribute\colorattribute\attributeunsetvalue \attribute\transparencyattribute\attributeunsetvalue} +% todo: check if color is overloading a non-color command + +\newcount\c_colo_protection + +\unexpanded\def\startprotectedcolors + {\advance\c_colo_protection\plusone} + +\unexpanded\def\stopprotectedcolors + {\advance\c_colo_protection\minusone} + \def\colo_basics_define[#1][#2]% {\ctxcommand{defineprocesscolor("#1","#2",false,\v_colo_freeze_state)}% - \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}% + \fi} \def\colo_basics_define_global[#1][#2]% {\ctxcommand{defineprocesscolor("#1","#2",true,\v_colo_freeze_state)}% - \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}% + \fi} \def\colo_basics_define_named[#1][#2]% currently same as define {\ctxcommand{defineprocesscolor("#1","#2",false,\v_colo_freeze_state)}% - \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}% + \fi} \def\dodefinefastcolor[#1][#2]% still not fast but ok (might change) {\ctxcommand{defineprocesscolor("#1","#2",false,\v_colo_freeze_state)}% - \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}% + \fi} \def\colo_basics_defined_and_activated#1% {\ctxcommand{defineprocesscolor("\v_colo_dummy_name","#1",false,false)}% @@ -717,11 +735,15 @@ \def\colo_basics_define_process_yes[#1][#2][#3]% {\ctxcommand{defineprocesscolor("#1","\processcolorcomponents{#2},#3",false,\v_colo_freeze_state)}% - \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}% + \fi} \def\colo_basics_define_process_nop[#1][#2][#3]% {\ctxcommand{defineprocesscolor("#1","#2",false,\v_colo_freeze_state)}% - \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}% + \fi} % Spotcolors used setxvalue but that messes up currentcolor % and probably no global is needed either but they are global @@ -730,11 +752,15 @@ \def\colo_basics_define_spot[#1][#2][#3]% {\ctxcommand{definespotcolor("#1","#2","#3",true)}% - \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}% + \fi} \def\colo_basics_define_multitone[#1][#2][#3][#4]% {\ctxcommand{definemultitonecolor("#1","#2","#3","#4",true)}% - \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}} + \ifcase\c_colo_protection + \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}% + \fi} %D Transparencies (only): |