You are not logged in.
Peachy this gradient code is top-notch Sir! 

I am going to write some of these repetitive shapes into functions.. good suggestion. 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
thanks falldown
good idea about the shapes
for the pentagon shape you would send the function x,y,color,alpha
main function()
--draw pentagon 1
pentagon(x,y,c,a)
--draw pentagon 2
pentagon(x,y,c,a)
end--main function
pentagon (px,py,pcolor,palpha)
subtab{
{d="start",x=px,y=py},
{other sub tab drawing stuff}
}
grec({sub=1,subtab=subtab,grad={{c=pcolor,a=palpha}},other grec settings})
end--pentagon functionLast edited by mrpeachy (2012-10-02 04:50:29)
Offline
Looking good there falldown. You two are going hell-bent for space here.
@ mrpeachy - did you drop your "borg" conky?
Offline
@Sector11 - not drop exactly... i have been busy with other things so conky has had to take a bit of a back seat recently
Offline
@Sector11 - not drop exactly... i have been busy with other things so conky has had to take a bit of a back seat recently
Got you loud and clear - I'm in the same boat.
Offline
^^ and ^ Yes yes.. RL has taken the majority of my time as well.
Peachy I am thinking of incorporating xplanet into this theme.
I want to add it to the weather section.
I have yet to check how much resources it uses.
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
i want to display an rss-feed. each entry should have an 'more'. you click on the word on the respective webpage opens then.
the webpage contains the 'headline' and the respective link:
<tr>
<td nowrap="nowrap">04.10.2012 </td>
<td><a href="/index.php?section=news&cmd=details&newsid=613" title="Curiosity bei der Düne namens Rocknest">Curiosity bei der Düne namens Rocknest</a></td>
</tr>or the rss-feed (xml-file):
<item>
<title>Curiosity bei der Düne namens Rocknest</title>
<link>
http://www.marspages.eu/index.php?section=news&cmd=details&newsid=613&teaserId=
</link>
<category domain="http://www.marspages.eu/index.php?section=news&category=10">Mars Science Laboratory</category>
<pubDate>Thu, 04 Oct 2012 21:30:31 +0200</pubDate>
</item>do u have an idea how to realize this?
“If you wish to make an apple pie from scratch, you must first invent the universe.” Carl Sagan
Offline
I have been so busy recently.. Haven't had the time to play. 
I have added (or I have attempted to add) some depth to this..
Hope all is well with everyone 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
very nice
ill have to ponder a while to see if i like it better than the flat shapes in your previous shot 
how are you applying the gradient to the blue pentagon shape?
i'm well... just busy with other things. So i will join you with 
Last edited by mrpeachy (2012-10-11 00:38:28)
Offline
^^ & ^
That makes three of us - seems to be going around, I'm in and out in spurts, being busy with other things as well. Just when I think 'I'm back' ... oops!
@ falldown - that's awesome! I definitely like it!
Offline
I'm doing it the hard way Peachy.. 
I do a solid color shape
next I do a black layer set at g=1 with black gradient at {a=0.7,p=0}{a=0,p=0.5}{a=0.7,p=1}
and another layer set at g=2 with the same gradient as above.
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Thanks guys!! 
Just a lot of school activities going on with the young ones.
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
I'm doing it the hard way Peachy..
I do a solid color shape
next I do a black layer set at g=1 with black gradient at {a=0.7,p=0}{a=0,p=0.5}{a=0.7,p=1}
and another layer set at g=2 with the same gradient as above.
thats what i suspected... but not the hard way, seems entirely reasonable to me 
Offline
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
im thinking the gradrec function needs a circular gradient option 
Offline
Good to see two master at work again!
Lookin' good!
Offline
im thinking the gradrec function needs a circular gradient option
That might be the best thing that I have heard all week.. or maybe the best disguised criticism of the week!! 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
That might be the best thing that I have heard all week.. or maybe the best disguised criticism of the week!!
Or a touch of both with a bit of bat wings. 
Offline
Peachy I wasn't being serious about the criticism joke above.
A circular grec would be awesome as well as a grec that could be used with text.. (like maybe a subtab=subtab) function. subtab=text or however it would look.
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
^ i know, and there wasn't a hint of criticism in my statement 
that is a good idea to combine text into the function
i have been working on a text function that does some things with gradients and text positioning
ill see if i can get the circular gradient implemented today
Offline
ok, try this
should replace the existing grec function without anything breaking
function grec(gtab)--#################################################################################
local function color(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local function pt(px,py,prad,pdeg)
local ppo=(math.pi/180)*pdeg
local px1=px+prad*(math.sin(ppo))
local py1=py-prad*(math.cos(ppo))
return px1,py1
end
local function sub_draw(sdtab)
cdsx={}
cdsy={}
dr={}
limit=#sdtab
for i=1,limit do
local d=sdtab[i].d
if d=="start" then
table.insert(dr,"cairo_move_to(cr,"..tostring(sdtab[i].x)..","..tostring(sdtab[i].y)..");")
table.insert(cdsx,sdtab[i].x)
table.insert(cdsy,sdtab[i].y)
end
if d=="line" then
table.insert(dr,"cairo_line_to(cr,"..tostring(sdtab[i].x)..","..tostring(sdtab[i].y)..");")
table.insert(cdsx,sdtab[i].x)
table.insert(cdsy,sdtab[i].y)
end
if d=="rline" then
table.insert(dr,"cairo_rel_line_to(cr,"..tostring(sdtab[i].x)..","..tostring(sdtab[i].y)..");")
table.insert(cdsx,cdsx[i-1]+sdtab[i].x)
table.insert(cdsy,cdsy[i-1]+sdtab[i].y)
end
if d=="aline" then
--pt(px,py,prad,pdeg)
local alx,aly=pt(cdsx[i-1],cdsy[i-1],sdtab[i].l,sdtab[i].a)
table.insert(dr,"cairo_line_to(cr,"..tostring(alx)..","..tostring(aly)..");")
table.insert(cdsx,alx)
table.insert(cdsy,aly)
end
if d=="arc" then
local ang1=(math.pi/180)*((sdtab[i].a1)-90)
local ang2=(math.pi/180)*((sdtab[i].a2)-90)
local rad=sdtab[i].r
local x=sdtab[i].x
local y=sdtab[i].y
table.insert(dr,"cairo_arc(cr,"..tostring(x)..","..tostring(y)..","..tostring(rad)..","..tostring(ang1)..","..tostring(ang2)..");")
local ang2=(math.pi/180)*(sdtab[i].a2)
local ax=0+rad*(math.sin(ang2))
local ay=0-rad*(math.cos(ang2))
table.insert(cdsx,x+ax)
table.insert(cdsy,y+ay)
end
if d=="arc_c" then
local q=sdtab[i].q
local rad=sdtab[i].r
if q==4 then
ang1=(math.pi/180)*(270-90)
x=cdsx[i-1]+rad
y=cdsy[i-1]
elseif q==1 then
ang1=(math.pi/180)*(360-90)
x=cdsx[i-1]
y=cdsy[i-1]+rad
elseif q==2 then
ang1=(math.pi/180)*(90-90)
x=cdsx[i-1]-rad
y=cdsy[i-1]
elseif q==3 then
ang1=(math.pi/180)*(180-90)
x=cdsx[i-1]
y=cdsy[i-1]-rad
end
local ang2=ang1+((math.pi/180)*(sdtab[i].degs))
table.insert(dr,"cairo_arc(cr,"..tostring(x)..","..tostring(y)..","..tostring(rad)..","..tostring(ang1)..","..tostring(ang2)..");")
local ang2=ang2+((math.pi/180)*90)
local ax=0+rad*(math.sin(ang2))
local ay=0-rad*(math.cos(ang2))
table.insert(cdsx,x+ax)
table.insert(cdsy,y+ay)
end
if d=="arc_a" then
local q=sdtab[i].q
local rad=sdtab[i].r
if q==4 then
ang1=(math.pi/180)*(360-90)
x=cdsx[i-1]
y=cdsy[i-1]+rad
elseif q==1 then
ang1=(math.pi/180)*(90-90)
x=cdsx[i-1]-rad
y=cdsy[i-1]
elseif q==2 then
ang1=(math.pi/180)*(180-90)
x=cdsx[i-1]
y=cdsy[i-1]-rad
elseif q==3 then
ang1=(math.pi/180)*(270-90)
x=cdsx[i-1]+rad
y=cdsy[i-1]
end
local ang2=ang1-(math.pi/180)*(sdtab[i].degs)
table.insert(dr,"cairo_arc_negative(cr,"..tostring(x)..","..tostring(y)..","..tostring(rad)..","..tostring(ang1)..","..tostring(ang2)..");")
local ang2=ang2+((math.pi/180)*90)
local ax=0+rad*(math.sin(ang2))
local ay=0-rad*(math.cos(ang2))
table.insert(cdsx,x+ax)
table.insert(cdsy,y+ay)
end
end
return table.concat(dr)
end--of local function sub_draw
local g=gtab.g or 1
local x=gtab.x or 0
local y=gtab.y or 0
local w=gtab.w or 50
local h=gtab.h or 50
local r=gtab.r or 50
local rgx=gtab.rgx or x
local rgy=gtab.rgy or y
local grad=gtab.grad or {{c=0xffffff}}
local gan=gtab.gan or 45
local lw=gtab.lw or 1
local sub=gtab.sub or 0
local db=gtab.db or 0
local subtab=gtab.subtab
if db==1 and g~=6 then
cairo_set_source_rgba (cr,1,1,1,1)
cairo_set_line_width (cr,1)
cairo_rectangle (cr,x,y,w,h)
cairo_stroke (cr)
elseif db==1 and g==6 then
cairo_set_source_rgba (cr,1,1,1,1)
cairo_set_line_width (cr,1)
cairo_arc (cr,x,y,r,0,2*math.pi)
cairo_stroke (cr)
end
--##########################################
if g==1 or g==2 or g==5 or g==6 then --rectangular gradients
if g==1 then
pat = cairo_pattern_create_linear (0,y,0,y+h);
elseif g==2 then
pat = cairo_pattern_create_linear (x,0,x+w,0);
elseif g==5 then
--calculate hypotenuse across middle of rectange
local hyp=math.sqrt((w^2)+(h^2))
local rad=hyp/2
--center point of rectangle
local crx=x+(w/2)
local cry=y+(h/2)
--calculate point 1
local point=(math.pi/180)*gan
local x1=crx+rad*(math.sin(point))
local y1=cry-rad*(math.cos(point))
--calculate point 2
local point=(math.pi/180)*(gan+180)
local x2=crx+rad*(math.sin(point))
local y2=cry-rad*(math.cos(point))
--gradient
pat = cairo_pattern_create_linear (x1,y1,x2,y2);
elseif g==6 then
pat = cairo_pattern_create_radial (rgx, rgy, 0, x, y, r);
end
local gnum=#grad
for i=1,gnum do
cairo_pattern_add_color_stop_rgba (pat,grad[i].p,color(grad[i].c,grad[i].a));
end--for loop
if sub==1 then
cairo_save (cr)
cairo_clip(cr)
cairo_new_sub_path(cr)
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_restore (cr)
end
cairo_set_source (cr, pat);
cairo_fill(cr);
cairo_pattern_destroy (pat);
--###########################################
elseif g==0 and sub==1 then --non gradient
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill(cr)
elseif g==3 and sub==1 then
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_close_path (cr)
cairo_stroke(cr);
elseif g==4 and sub==1 then
local drawstring=sub_draw(subtab)
loadstring(drawstring)()
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill_preserve(cr);
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[2].c,grad[2].a));
cairo_close_path (cr)
cairo_stroke(cr);
elseif g==0 and sub~=1 then
cairo_rectangle (cr,x,y,w,h)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill(cr);
elseif g==3 and sub~=1 then
cairo_rectangle (cr,x,y,w,h)
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_close_path (cr)
cairo_stroke(cr);
elseif g==4 and sub~=1 then
cairo_rectangle (cr,x,y,w,h)
cairo_set_source_rgba (cr,color(grad[1].c,grad[1].a));
cairo_fill_preserve(cr);
cairo_set_line_width(cr,lw)
cairo_set_source_rgba (cr,color(grad[2].c,grad[2].a));
cairo_close_path (cr)
cairo_stroke(cr);
--radial gradients
elseif g==6 then
pat = cairo_pattern_create_radial (cx, cy, crad-(clw/2)-2,--
cx, cy, crad+(clw/2)+4);
cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1);
cairo_pattern_add_color_stop_rgba (pat, 0.5, 0, 0, 0, 0);
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
cairo_set_source (cr, pat);
cairo_arc (cr, cx, cy, crad+(clw/2), 0, 2*math.pi);
cairo_fill (cr);
cairo_pattern_destroy (pat);
end--of g type
end--of function greca couple of new things first
g=6 sets the radial gradient
uses the same method of colors and points as the other gradient types
when g=6 x and y settings are now the middle of the gradient rather than the bottom left corner
set db=1 and you get a circle instead of a rectangle
when g=6 set r=radius of circle (w and h not used)
to adjust the gradient set
rgx= (radial gradient x)
rgy= (radial gradient y)
these setting move the center point of the gradient around within the circle
if rgx and rgy are not set, the gradient center point is at x,y
also there is another drawing option
d=aline
this allows you to specify a length and an angle and the script draws a line to that point
try this out and youll see how aline and g=6 work
subtab={
{d="start",x=200,y=200},
{d="aline",l=50,a=45},
{d="aline",l=50,a=135},
{d="aline",l=50,a=180+45},
{d="aline",l=50,a=270+45},
}
grec({g=6,r=40,x=235,y=200,rgx=235,rgy=220,w=50,h=-50,grad={{c=0xffff00,a=1,p=0},{c=0x0000ff,a=1,p=1}},lw=2,sub=1,db=1,subtab=subtab})Last edited by mrpeachy (2012-10-12 20:05:06)
Offline
Very
Peachy!!
This aline looks interesting.
Time to play!! 
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
Peachy's v9000 / Conky PitStop / My DA Page / VSIDO
Make it so....
Offline
^i think you should have a separate bar for each output rathet than up and down on the same one
other than that its coming along nicely
how far have you gotten?
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.