GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 9:44 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Cairo Gradient Patterns
PostPosted: Mon Nov 25, 2013 5:19 pm 
Offline
Familiar Face

Joined: Fri Aug 05, 2011 8:05 am
Posts: 22
The documentation says that after you have created a linear gradient pattern, you should add RGBA color stops. If I just add two such stops at offset 0 and offset 1, with opacity 0 and 1 I get a smooth progression between the two.

The documentation has nothing to say about this except "This can be useful for reliably making sharp color transitions instead of the typical blend". So what is the typical blend? What interpolation is used - it looks a bit like linear, except the beginning end of the gradient is a bit different.

Does anyone know? Is it documented anywhere?


Top
 Profile  
 
 Post subject: Re: Cairo Gradient Patterns
PostPosted: Tue Nov 26, 2013 10:50 am 
Offline
Familiar Face

Joined: Fri Aug 05, 2011 8:05 am
Posts: 22
I'd got my linear boundary condition wrong at one end. Correcting my code, the result with the Cairo defalt gradient is visually indistinguishable.

I have written a short article on opacity gradients that you might want to experiment with. It uses D and the gtkd-2 library.

http://britseyeview.com/software/articles/opacity.html


Top
 Profile  
 
 Post subject: Re: Cairo Gradient Patterns
PostPosted: Wed Nov 27, 2013 8:23 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 768
Location: UK
Hello,

Was going to point you to these tutorials on Cairo one from the Cairo web site and one from Zetcode
http://cairographics.org/tutorial/
http://zetcode.com/gfx/cairo/

Been busy eliminating the spammers from this site.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Cairo Gradient Patterns
PostPosted: Mon Dec 02, 2013 5:32 pm 
Offline
Familiar Face

Joined: Fri Aug 05, 2011 8:05 am
Posts: 22
Thanks Errol, I think I've got the hang of it now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group