in reply to color selection image map

You say nothing of how you want to select your colors.Do you want to select from a fixed MxN palette or abitrarily zoom in on a RGB color cube?

-Lee

"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
RGB color selection
by shotgunefx (Parson) on May 22, 2002 at 22:10 UTC
    Here's a rough idea for a zooming version that would let you select arbitrary colors using RGB.

    You'll need to use GD or Image magik to generate the images which will be 255x255. Well that or generate a raw image file which I don't recommend.

    Use the x axis for green and y for red. What I mean is that point 0,0 should be (Red,Green) = (0,0) Point 255,255 will be (Red,Green) = (255,255).

    By using an image type input, you will be able to dicern what value the user clicked by using the x,y as indexes. You've now got the red and green values.

    You will need a text input field for Blue which you can think of as the z axis of the cube. The only downside is generating the images. You could generate them and store them instead for speed as uncompressed it's only about a meg total.

    When the user changes the blue axis, you just use that as an index to the right image (Or generate it dynamically). Then you just take the x,y of the click and the blue index and you have your color. The plus side of the complexity is that you can select any RGB value possible.

    I may get around coding this myself (It's been on my list for awhile) but right now I don't have the time to put it together.

    Good luck

    -Lee

    "To be civilized is to deny one's nature."