% MetaPost of new Haskell logo % Based on a public domain PNG by Jeff Wheeler, % And on logo contest entries by George Pollard, Darrin Thompson, and others. % % (c) 2009 Brian Sniffen % % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions % are met: % % 1. Redistributions of source code must retain the above copyright % notice, this list of conditions and the following disclaimer. % % 2. Redistributions in binary form must reproduce the above copyright % notice, this list of conditions and the following disclaimer in the % documentation and/or other materials provided with the distribution. % % 3. Neither the name of the author nor the names of his contributors % may be used to endorse or promote products derived from this software % without specific prior written permission. % % THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS % OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED % WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE % DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR % ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL % DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS % OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) % HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, % STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN % ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % POSSIBILITY OF SUCH DAMAGE. %h = 1cm; % scaling parametter %m = 3/2; % slope of lines linejoin:=mitered; path stdrangle, stdlambda, stdlambdabody, stdlambdaleg, upperequal, lowerequal; def rangle(expr h,m) = origin -- (4*h,4*m*h) -- (0,8*m*h) -- (3*h,8*m*h) -- (7*h,4*m*h) -- (3*h,0) -- cycle enddef; def lambdabody(expr h,m) = (rangle(h,m)) shifted (4*h,0) enddef; def lambdaleg(expr h,m) = ((11*h,0) -- (8*h,0) -- (0,8*m*h) -- (3*h,8*m*h) -- cycle) shifted (4*h,0) enddef; def lambda(expr h,m) = (4*h,0) -- (8*h,4*m*h) -- (4*h,8*m*h) -- (7*h,8*m*h) -- (15*h,0) -- (12*h,0) -- (9.5*h,2.5*m*h) -- (7*h,0) -- cycle enddef; def equalsign(expr h,m)(expr maxx,miny) = begingroup % The equal sign is 5 units high: two units thick in each block, % with one unit thickness of white between. Being centered, that % puts its outer corners at 3.5, 5.5, 6.5, and 8.5. The right edge % is at 17 units. The left edge is the standard 1-unit horizontal % gap from the lambda. % These gaps are all by horizontal measure---the components are % closer than 1 unit to each other. save cutoff,p,q,maxy; path cutoff,q; pair p[]; maxy = miny + 4/3; cutoff = (16*h,0*h) -- (8*h,8*m*h); p1 = ((maxx*h,miny*m*h) -- (0*h,miny*m*h)) intersectionpoint cutoff; p2 = ((maxx*h,maxy*m*h) -- (0*h,maxy*m*h)) intersectionpoint cutoff; q = p1 -- p2 -- (maxx*h,maxy*m*h) -- (maxx*h,miny*m*h) -- cycle; q endgroup enddef; stdrangle = rangle(1,3/2); stdlambda = lambda(1,3/2); stdlambdabody = lambdabody(1,3/2); stdlambdaleg = lambdaleg(1,3/2); lowerequal = equalsign(1,3/2)(17,7/3); upperequal = equalsign(1,3/2)(17,13/3); beginfig(0); % Two grays, single-body lambda fill stdrangle withcolor 0.4white; fill stdlambda withcolor 0.6white; % lighter fill lowerequal withcolor 0.4white; fill upperequal withcolor 0.4white; endfig; beginfig(1); % Two grays, split-body lambda fill stdrangle withcolor 0.4white; % leg must be drawn first so that body covers it fill stdlambdaleg withcolor 0.4white; fill stdlambdabody withcolor 0.6white; % lighter fill lowerequal withcolor 0.4white; fill upperequal withcolor 0.4white; endfig; beginfig(2); % outlined, single-body lambda draw stdrangle; % leg must be drawn first so that body covers it draw stdlambda; draw lowerequal; draw upperequal; endfig; beginfig(3); % outlined, split-body lambda draw stdrangle; % leg must be drawn first so that body covers it draw stdlambdaleg; unfill stdlambdabody; draw stdlambdabody; draw lowerequal; draw upperequal; endfig; beginfig(4); % Two grays, single-body lambda begingroup; save h; h = 1; fill (stdrangle shifted (-4*h,0)) withcolor 0.4white; fill (stdrangle shifted (-8*h,0)) withcolor 0.4white; fill (stdrangle shifted (-12*h,0)) withcolor 0.4white; fill stdrangle withcolor 0.4white; fill stdlambda withcolor 0.6white; % lighter fill equalsign(h,3/2)(30,7/3) withcolor 0.4white; fill equalsign(h,3/2)(30,13/3) withcolor 0.4white; endgroup; endfig; beginfig(5); % solid black fill stdrangle; fill stdlambda; fill lowerequal; fill upperequal; endfig; bye