http://easypim.sourceforge.net/color/
Break my code
Moderator: General Moderators
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
Break my code
Ok, I have this thing working great, so now I need people to try and break my code. Give it your best shot. I have a good feeling that it's break-proof
http://easypim.sourceforge.net/color/
http://easypim.sourceforge.net/color/
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
Well, although some browsers may recognize those codes as being valid, it is definitely not standard.
According to http://www.w3schools.com/html/html_colorsfull.asp Hex color codes are 6-chars long.
Each Red, Green, and Blue is represented by a 2-char hex.
So with this RGB: 10 11 12 , the represented numbers in hex would be 0A 0B 0C which means #0A0B0C .. if the hex is only 1 char long, then it has to have a 0 followed by the character. This also applies to RGB: 0 1 2, which is #000102
According to http://www.w3schools.com/html/html_colorsfull.asp Hex color codes are 6-chars long.
Each Red, Green, and Blue is represented by a 2-char hex.
So with this RGB: 10 11 12 , the represented numbers in hex would be 0A 0B 0C which means #0A0B0C .. if the hex is only 1 char long, then it has to have a 0 followed by the character. This also applies to RGB: 0 1 2, which is #000102
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
The way that the colorchart.php script works (web-safe color popup) is it dynamically generates an HTML table with the <td bgcolor=""> == to the corresponding web-safe color. I have tested the popup on many different browsers/platforms, and there is really no way for me to make the popup window the correct size.RandomEngy wrote:Just a note, clicking on the web-safe colors for me pops up a window that I have to resize in order to see all of the colors.
Some browsers the window is sized perfectly, some browsers the window is too big, and in your case it is too small. Until I can figure out a better way to display the colors, this will have to be the way that is works.
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
Well, I could do that, but then I run across another problem. The way that hyperlinks are created is that populates each cell with the link. Now I suppose I could use CSS or something to make the each <td> cell clickable. That way I could change the width of each of the cells and not worry about the whole cell not being clickable.RandomEngy wrote:Well, if the table is the same all of the time, just make it a static table with no cellpadding and cellspacing, and each cell a set width and height. That should make the table size exactly x-pixels high and y-pixels wide.
Shouldn't it?
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Gif for fixed width?
Perhaps you could use a tdot.gif (transparent dot) of a particular width and height as clickable.
This should be easier to constrain than -- just make sure that there are no extra spaces or new-lines inside the <td></td>.
However there are certainly some browser versions that mess this up - but, hey that's what html is like.
Toro
This should be easier to constrain than -- just make sure that there are no extra spaces or new-lines inside the <td></td>.
However there are certainly some browser versions that mess this up - but, hey that's what html is like.
Toro
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
Yes, exactly. I just modified the code a bit and now it shouldn't be a problem though. Check it out and let me know if this is better.RandomEngy wrote:Ahh, I see the problem now... Gotta have something to click on, and the width modifier doesn't constrain the cell when the spaces run more than the width.
http://easypim.sourceforge.net/color
Basically I did this:
Code: Select all
<td bgcolor="web_safe_code" onclick="choose_color" style="cursor: pointer"> </td>- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact: