Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » m_wndColorCtrl=MODE_HEXAGON and setting RGB color Collapse All
Subject Author Date
Olaf Baeyens Mar 27, 2003 - 7:24 AM

This CExtColorCtrl works great now, but when CExtColorCtrl is in MODE_HEXAGON mode and if I then set m_wndColorCtrl.SetupColor(RGB()) with a value that is not /256 (or is it 255?) then the selection is not shown.

It has something to do with matching the color of the cell with the RGB color and when they match then the focus is set. But the problem is that the cell color is slightly different than the selected color so no fucus is drawn.

Maybe it would be nice if a different focus symbol is used in this case indicating that the color shown is a near match?

Sergiy Lavrynenko Mar 28, 2003 - 6:54 AM

Dear Olaf,

Thank you for the comment.
Red, green or blue value inside COLORREF has one byte size. Minimal value is 0, maximal is 255 (or 0x0FF). Number 256 (or 0x100) is 1-bit out of byte limit :-)

To find the solution of the color-selection problem in hexagon-color-picker we need to discuss this problem in details. It is not difficult to calculate and highlight a nearest color. But which color is really nearest? You can easily note in the top-palette (non-grayscale) all colors are not very dark. If the current real color is dark-red and not matched with the darkest red in the top palette – which cell should be highlighted? Big black cell at bottom or nearest red cell in the top-palette that is not enough dark? Both colors may be not very like to real.

I think palettes are toys :-) They should not display any selection if it is not match with the real color in a document. This will allow user to avoid misunderstanding.

Best regards,
Sergiy Lavrynenko.