Re: canvas item color



>  How can I set a canvas item's color without specifying the color name?

The canvas needs to be extended to allow the fill_color_rgba argument
in items to work even for the non-AA case.  I'll probably do it this
weekend.

In the meantime, you can do something like

	/* Colors are in the [0, 65535] range */
	char *
	get_color_spec (int r, int g, int b)
	{
		static char spec[50];
	
		sprintf (spec, "#%04x%04x%04x", r, g, b);
		return spec;
	}

and use that as the color spec passed to the fill_color arguments.
You can modify it as appropriate for colors in the [0, 255] range.

  Federico



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]