summaryrefslogtreecommitdiff
path: root/metapost/context/base/mp-mlib.mpiv
diff options
context:
space:
mode:
Diffstat (limited to 'metapost/context/base/mp-mlib.mpiv')
-rw-r--r--metapost/context/base/mp-mlib.mpiv27
1 files changed, 27 insertions, 0 deletions
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index 5b88c3159..c7240e127 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -583,3 +583,30 @@ def bitmapimage(expr xresolution, yresolution, data) =
withpostscript data ;
)
enddef ;
+
+% TODO:
+
+let property = picture ;
+
+vardef properties(text t) =
+ image(draw unitcircle t)
+enddef ;
+
+def withproperties expr p =
+ if colormodel p = 3 :
+ withcolor graypart p
+ elseif colormodel p = 5 :
+ withcolor (redpart p,greenpart p,bluepart p)
+ elseif colormodel p = 7 :
+ withcolor (cyanpart p,magentapart p,yellowpart p,blackpart p)
+ fi
+ % todo, when available in mp:
+ %
+ % withprescript prescript p
+ % withpostscript postscript p
+ %
+ % todo, penpart
+enddef ;
+
+% property p ; p = properties(withcolor (1,1,0,1)) ;
+% fill fullcircle scaled 20cm withproperties p ;