Esempio n. 1
0
med = '#C11373' #'LawnGreen'
dark = '#8b0a50' #'#5D9B90'

fout = '../images/lime/check-hu.png'
fout2 = '../images/lime/check-nu.png'

Gr_Base_Rect(fout,w,h,exp,radius,first,second,startc,stopc,tab)

img = Image.open('../images/lime/check-hu.png')
dimg = img.convert('L')
img = ImageOps.expand(img, border= (0,0,2,0), fill=(0,0,0,0))
img.save('../images/lime/check-hu.png')


dimg = dimg.convert('RGBA')
trans(dimg,w,h,radius)
dimg = ImageOps.expand(dimg, border= (0,0,2,0), fill=(0,0,0,0))
dimg.save('../images/lime/check-du.png')

idraw = ImageDraw.Draw(img)

def cross(idraw):
    idraw.line([4,3,w-3,h-5],fill=light)
    idraw.line([2,4,w-5,h-4],fill=med)
    idraw.line([2,h-5,w-5,3],fill=light)
    idraw.line([4,h-4,w-3,4],fill=med)
    idraw.line([3,h-4,w-3,3],fill=dark)
    idraw.line([2,3,w-4,h-4],fill=dark)
    idraw.line([3,3,w-3,h-4],fill=dark)
    idraw.line([2,h-4,w-4,3],fill=dark)
    
Esempio n. 2
0
radius = 3  # gap size
re = radius * exp
centreX = (w - 1) / 2
centreY = (h - 1) / 2
hypotSq = (w - 3) * (w - 3) + (h - 3) * (h - 3)

first = '#2D4C46'  # '#5D9B90'
second = 'white'  #(102,153,204)back

stopc = (222, 247, 222)  # (143,188,143)
startc = (95, 156, 142)  #(143,188,143)

img = gr_2d_rect(we, he, exp, re, first, second, stopc, startc)

img = img.resize((w, h), Image.LANCZOS)
trans(img, w, h, radius, 730)
# used on horizontal
img.save('../images/lime/iprog.png')

rimg = Image.new('RGBA', (w, h), second)
rdraw = ImageDraw.Draw(rimg)

rdraw.rectangle([0, 0, w - 1, h - 1], outline=first)

for y in range(1, h - 1):
    rise = centreY - y
    rise *= rise

    for x in range(1, w - 1):
        run = centreX - x
        run *= run
stopc = (143, 188, 143)  #(222,247,222) (225,242,238)
toci = (143, 188, 143)  #(222,247,222) (210,242,234)
fout = '../images/lime/slider-hn.png'
tab = 0

Gr_Base_Rect(fout, w, h, exp, radius, first, second, startc, stopc, tab)

img = Image.open('../images/lime/slider-hn.png')

#rimg = img.rotate(90)
img.transpose(Image.ROTATE_90).save('../images/lime/slider-vn.png')
rimg = Image.open('../images/lime/slider-vn.png')

drimg = rimg.convert('L')
drimg = drimg.convert('RGBA')
trans(drimg, h, w, radius)
drimg.save('../images/lime/slider-vd.png')

#primg = img.rotate(270)
img.transpose(Image.ROTATE_270).save('../images/lime/slider-vp.png')
#primg.Image.open('../images/lime/slider-vp.png')

pimg = img.rotate(180)
pimg.save('../images/lime/slider-hp.png')

dimg = img.convert('L')
dimg = dimg.convert('RGBA')
trans(dimg, w, h, radius)
dimg.save('../images/lime/slider-hd.png')

aimg = img.point(lambda p: p * 1.1)
Esempio n. 4
0
stopc = (87, 137, 87)  #(222,247,222) (210,242,234)

img = gr_base(we, he, exp, re, first, second, startci, stopci)
#img.save('../images/lime/ibutton-n.png')

grad = Image.new('RGBA', (we, he), 'white')
igrad = ImageDraw.Draw(grad)

# gradient
for j in range(steps):
    cr, cg, cb = LerpColour(startc, stopc, j / (steps - 1))
    igrad.line([0, j, we - 1, j], fill=(cr, cg, cb))

#grad.save('../images/lime/grad.png')

limg = ImageChops.lighter(grad, img)
limg = limg.resize((w, h), Image.LANCZOS)
trans(limg, w, h, radius)
limg.save('../images/lime/button-n.png')

pimg = limg.rotate(180)
pimg.save('../images/lime/button-p.png')

aimg = limg.point(lambda p: p * 1.1)
aimg.save('../images/lime/button-a.png')

dimg = limg.convert('L')
dimg = dimg.convert('RGBA')
trans(dimg, w, h, radius)
dimg.save('../images/lime/button-d.png')