Re: [gtkmm] Gdk::Color - can't understand



Igor Gorbounov <igorbounov voronezh serw ru> writes:

> Explain me, why values in Gdk::Color::set_rgb(red, green, blue) must
> be 2-byte values? I mean, that to produce a 0x3fafc0 color I have to
> write it as set_rgb(0x3fff, 0xafff, 0xc0ff), adding one extra byte
> to every color component.

Perhaps because the people who designed the API thought that perhaps
we would use more than 8 bit per component in the future? I think
scanners work with 48 bits.

But it's a nuisance, I've been bitten by it myself before.

> And next, from reading gtkmm and gtk documentation I nevertheless
> can't understand whether I really do need colormap or just can
> easily live on with Gdk::Drawable::set_rgb_foreground() to draw my
> rectangles and lines on a drawingarea.

I've never understood it either. So instead I use the Gnome Canvas.
Perhaps someone on the plain gtk-list knows the answer?

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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