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."
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.