[cairo] Repeating gradient patterns

J. Ali Harlow ali at juiblex.co.uk
Sat Aug 23 08:24:26 PDT 2008


Guys,

I'm trying to use repeating gradient patterns to draw the background 
for a matrix of 27x27 cells. Cells are labelled with two colours. I 
want to show these by placing the first colour in the top-left corner 
and the second colour in the bottom-right corner. The obvious way to do 
that in cairo seems to be to use a gradient pattern. However, I have 
two problems:

* The period of the repeating patterns seems to be too small. If you 
just run your eye from the top-left cell down the diagonal to the 
bottom-right this is quite obvious.

* Half the cells are drawn as expected with the colour stops in the 
corners. The other half have the colour stops in the middle.

I attach a test problem to show what I am doing as well as it's output 
(png). Any pointers as to what I'm doing wrong would be much 
appreciated.

Thanks,

Ali.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gradient-tile.c
Type: text/x-csrc
Size: 1552 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080823/fc6df0db/attachment-0001.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gradient-tile.png
Type: image/png
Size: 60648 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080823/fc6df0db/attachment-0001.png 


More information about the cairo mailing list