[cairo] Solid color pattern constructors

Kristian Høgsberg krh at bitplanet.net
Tue Jun 28 15:51:16 PDT 2005


Carl Worth wrote:
> On Tue, 28 Jun 2005 15:45:58 -0400, Kristian Høgsberg wrote:
> 
>>Here's a patch to add constructors for solid color patterns:
> 
> 
> Great! This will be quite handy to have, and fills an obvious hold in
> the API.
> 
> 
>>+/**
>>+ * cairo_pattern_create_rgb:
> 
> [...]
> 
>>+ * Create a new cairo_pattern_t corresponding to a solid, opaque
>>+ * color.
> 
> 
>>+/**
>>+ * cairo_pattern_create_rgba:
> 
> [...]
> 
>>+ * Create a new cairo_pattern_t corresponding to a solid, opaque
>>+ * color.
> 
> 
> Obviously the second version shouldn't have "opaque" in it as already
> mentioned.

Yup... the evils of cut and paste...

> And while the implementation does use "solid" for these kinds of
> patterns, it's not clear to me that that's the best word here,
> (particularly since some users may read "solid" as a synonym for
> "opaque").

Yes, that did cross my mind when I wrote it.

> When I documented set_source_rgb[a] I left "solid" out. So maybe this
> would be sufficient:
> 
> 	cairo_pattern_create_rgb
> 	Creates a cairo_pattern_t for an opaque color.
> 
> 	cairo_pattern_create_rgba
> 	Creates a cairo_pattern_t for a translucent color.
> 
> (or similar). Otherwise, please commit.

That's clearly better.  Committed.

Kristian



More information about the cairo mailing list