[metapost] Problem with simulated gradient

Jesús Guillermo Andrade gandrade at usermail.com
Thu Mar 19 17:36:49 CET 2009


Dear Fellows: I´ve been working over this problem for a long time and  
so far I haven't got the desired results. I need to create a linear  
gradient (or at least simulate it) from left to right in a polygon. I  
don't want to use metafun and the problem is how to fake it in eps. I  
am in urgent need for a solution and I don´t have anyone to ask for  
help excepto for this list. Could anybody help me please?
This is code I have so far:

% A&M Logo
% Por Guillermo Andrade
% -------------------------------
% Preparacion
prologues:=3;
filenametemplate "%j-%3c.eps";
fontmapfile "pdftex_dl14.map";
input mp-tool;
input mp-spec ;

u=1cm;
% Variables
color c[];
% Funciones

% Dibujos
beginfig(1);
   path eme; % this is the polygon I need filled with a simulated  
gradient from one color to another (horizontally).
   eme = (-2.4u,6.2u)--(-4.5u,6.2u)--(-5.9u,0u)--(-4.15u,5.28u)-- 
(-5.25u,0u)--(-3.8u,4.389u)--(-3.7u,4.134u)--(-4.6u,0u)--(-3.45u, 
3.485u)--(-3.30u,3.1u)--(-3.95u,0u)--(-3.15u,2.71u)--(-2.1u,0u)-- 
(0,0)--(0.81u,2.97u)--(2.0u,0u)--(4.10u,0u)--(1.7u,6.2u)--(-0.49u, 
6.2u)--(-1.38u,3.58u)--cycle;
%%% Relleno
   s := .1;
   alt:= 6.2u;
   lateral:= -6u;
for i=0 step s until 200:
   fill eme shifted (-6u+i,0) withcmykcolor (i/100)[(1,0.60,.60,0), 
(1,1,1,1)];
endfor;
endfig;
end;

Thanks a lot for you help.!!!

Los errores indetectables son infinitos en su variedad, en cambio los  
detectables por definición son limitados. Tercera Ley de fiabilidad de  
Gilb.
------------------------------
Jesús Guillermo Andrade (Abg.)
Gerente de Litigios y Corporativo. EDM. AC. API.
Andrade & Moreno S.C. (http://amlegal.wordpress.com/)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/metapost/attachments/20090319/847b78d9/attachment.html 


More information about the metapost mailing list