colorpicker - select screen pixel color ? 
Author Message
 colorpicker - select screen pixel color ?

Hi,

having seen all current tk color pickers, but not one I need,
I'd like to ask here:

I'm in need of a tk color picker with which I can say:
   'select the same color as THAT color',

so:  selecting a color already on the screen by clicking on it,
     within the same tk app will do, but anywhere on the screen
     would be better, and cross-platform would be great !

Does anyone know one, or can suggest how to build one ?

Bert



Sat, 10 May 2008 21:08:54 GMT  
 colorpicker - select screen pixel color ?
One simple way would be to display a photo image with the available
colors on a canvas or label, and retrieve the selected color by x/y
coordinate - rough sketch:

bind .x <1> {set color [$photo get %x %y]}



Sat, 10 May 2008 22:29:36 GMT  
 colorpicker - select screen pixel color ?

Quote:
> One simple way would be to display a photo image with the available
> colors on a canvas or label, and retrieve the selected color by x/y
> coordinate - rough sketch:

> bind .x <1> {set color [$photo get %x %y]}

Eh .. I meant: selecting a color that is already on the screen,
say of a button, canvas item or in your web browser view and using
that to color the tk object at hand.

Bert



Mon, 12 May 2008 16:38:04 GMT  
 colorpicker - select screen pixel color ?

Quote:


>> One simple way would be to display a photo image with the available
>> colors on a canvas or label, and retrieve the selected color by x/y
>> coordinate - rough sketch:

>> bind .x <1> {set color [$photo get %x %y]}

> Eh .. I meant: selecting a color that is already on the screen,
> say of a button, canvas item or in your web browser view and using
> that to color the tk object at hand.

That would require an extension that understands the native system
framebuffer.  There is one in treectrl called the 'loupe' command,
but it's not a documented feature and may move to another extension
(like Img) where it makes more sense.

--
   Jeff Hobbs, The Tcl Guy
   http://www.ActiveState.com/, a division of Sophos



Tue, 13 May 2008 00:18:01 GMT  
 colorpicker - select screen pixel color ?
On Thu, 24 Nov 2005 08:18:01 -0800,

Quote:

> > Eh .. I meant: selecting a color that is already on the screen,
> > say of a button, canvas item or in your web browser view and using
> > that to color the tk object at hand.
> That would require an extension that understands the native system
> framebuffer.  There is one in treectrl called the 'loupe' command,
> but it's not a documented feature and may move to another extension
> (like Img) where it makes more sense.

The Gtk-Demo I just started up, has an off-screen colour picker...  So
if you're just using an older version of Gtk, hang in there, it's
already made it this far.  :)

Another thing I've often thought would be nice, is support for multiple
colour schemes.  For instance, the colour picker in the current
versions of Gimp; above the colour square, are tabs for different ways
of getting to the colour you want (including the GTK-standard hue
disk and SV-triangle).  And having the colours show within the sliders
is mighty helpful also.  One alternate colour selection method I'd LOVE
to see added, is to present the colours from the rgb.txt file.

And finally, the colour picker should come with public functions for
converting (to and from RGB should do) the various colour schemes it
supports.  Last time I had a colour picker, it was annoying seeing the
HSV sliders in the picker, but having to track down the conversion
routine myself.  That's two different functions doing the same thing.

That, to my mind, would make the near perfect colour picker.  ;)

Fredderic



Tue, 13 May 2008 09:16:36 GMT  
 colorpicker - select screen pixel color ?

Quote:
> On Thu, 24 Nov 2005 08:18:01 -0800,

>> > Eh .. I meant: selecting a color that is already on the screen,
>> > say of a button, canvas item or in your web browser view and using
>> > that to color the tk object at hand.
>> That would require an extension that understands the native system
>> framebuffer.  There is one in treectrl called the 'loupe' command,
>> but it's not a documented feature and may move to another extension
>> (like Img) where it makes more sense.

> The Gtk-Demo I just started up, has an off-screen colour picker...  So
> if you're just using an older version of Gtk, hang in there, it's
> already made it this far.  :)

> Fredderic

Thanks to the both of you !

Because I already use tktreectrl I inspected the code (v 2.1) and
concluded that the loupe code is for X11 only, until this morning I read
Jeff's answer in another thread which pointed to tktreectrl's CVS.
Wel there it was, cross-platform and all !

I'll look into it .. thanks

Bert



Tue, 20 May 2008 16:44:34 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Win32 ASM programming of Sound and Painting to screen Pixel by pixel

2. Win32 ASM programming of Sound and Painting to screen Pixel by pixel

3. Getting pixel color under mouse cursor

4. Find Out the color of a pixel

5. find out the color of a pixel

6. The color of the pixel I click? (retry)

7. The color of the pixel I click?

8. Screen scrolling by pixel...

9. VESA pixels in high color

10. True color pixels

11. Reading the color of a pixel in mode 13h

12. writing pixels to the screen

 

 
Powered by phpBB® Forum Software