[cairo] Radial Patterns Repeat Radially

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Thu Mar 12 16:19:35 PDT 2015


On Thu, 12 Mar 2015 12:52:24 +0100, Andrea Canciani wrote:

> Gradients (as opposed to surface-based patterns) lack of a natural
> notion of tile.
> Linear gradients are quite simple and their current description might
> already be sufficient to provide the intuition of their behavior.

I have added another example
<https://github.com/ldo/qahirah_examples/blob/master/gradient_patterns>
to my qahirah_examples repo to demonstrate the repeat behaviour of
linear and radial gradients.

It doesn’t seem that hard to understand: linear gradients repeat in
steps of (x1 - x0) along the x axis and (y1 - y0) along the y axis.
Radial gradients extrapolate the radius steps in integer multiples of
(radius1 - radius0), and the centre position steps in integer multiples
of (cx1 - cx0, cy1 - cy0).

Does that sound right? I get some interesting effects when the step in
the radius almost, but not quite, cancels out the step in the circle
centres. :)


More information about the cairo mailing list