summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-05-19 06:40:13 +0300
committerMarius <mariausol@gmail.com>2011-05-19 06:40:13 +0300
commitb17f22aa285224dcf5b1dbccd795bc73b9a16426 (patch)
tree22984b597d5aacec58ceaf1cd7138c8bb1a5c892 /metapost
parentb714ce8e20b324368a7ab233be6fa9a0e50befa4 (diff)
downloadcontext-b17f22aa285224dcf5b1dbccd795bc73b9a16426.tar.gz
beta 2011.05.18 22:26
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mp13
-rw-r--r--metapost/context/base/mp-tool.mp12
2 files changed, 7 insertions, 18 deletions
diff --git a/metapost/context/base/mp-mlib.mp b/metapost/context/base/mp-mlib.mp
index 6c7115cb7..04c8be099 100644
--- a/metapost/context/base/mp-mlib.mp
+++ b/metapost/context/base/mp-mlib.mp
@@ -60,14 +60,15 @@ def multitonecolor(expr name, fractions, components, value) =
enddef ;
def transparent(expr alternative, transparency)(text c) =
- c
- withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
- withprescript "tr_transparency=" & decimal transparency
+ 1 % this permits withcolor x intoshade y
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
+ withprescript "tr_transparency=" & decimal transparency
+ withcolor c
enddef ;
def withtransparency(expr alternative, transparency) =
- withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
- withprescript "tr_transparency=" & decimal transparency
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
+ withprescript "tr_transparency=" & decimal transparency
enddef ;
def cmyk(expr c, m, y, k) =
@@ -416,7 +417,7 @@ def withshading (expr how)(text rest) =
enddef ;
primarydef a shadedinto b =
- 1
+ 1 % does not work with transparency
withprescript "sh_color=into"
withprescript "sh_color_a=" & colordecimals a
withprescript "sh_color_b=" & colordecimals b
diff --git a/metapost/context/base/mp-tool.mp b/metapost/context/base/mp-tool.mp
index 7f047fefc..4ada54429 100644
--- a/metapost/context/base/mp-tool.mp
+++ b/metapost/context/base/mp-tool.mp
@@ -132,18 +132,6 @@ cmykcolormodel := 7 ;
let grayscale = numeric ;
-% def colorlike(expr c) text v = % colorlike(a) b, c, d ;
-% forsuffixes i=v : % save i ;
-% if cmykcolor c :
-% cmykcolor i ;
-% elseif rgbcolor c :
-% rgbcolor i ;
-% else :
-% grayscale i ;
-% fi ;
-% endfor ;
-% enddef ;
-
vardef colorlike(text c) text v = % colorlike(a) b, c, d ;
save _p_ ; picture _p_ ;
forsuffixes i=v :