summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
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 :