"Chris Hohmann" <no****@thankyo u.com> wrote in message
news:u$******** ******@TK2MSFTN GP14.phx.gbl...
:
: "Roland Hall" <nobody@nowhere > wrote in message
: news:ee******** ******@TK2MSFTN GP15.phx.gbl...
: > "Adrienne" wrote in message
: > news:Xn******** *************** *****@207.115.6 3.158...
: > : Gazing into my crystal ball I observed Adrienne
: > : <ar********@sbc global.net> writing in
: > : news:Xn******** *************** ****@207.115.63 .158:
: > :
: > : > Gazing into my crystal ball I observed "Roland Hall"
<nobody@nowhere >
: > : > writing in news:#q******** ******@TK2MSFTN GP10.phx.gbl:
: > : >
: > : >> "Adrienne" wrote in message
: > : >> news:Xn******** *************** ****@207.115.63 .158...
: > : >>: Gazing into my crystal ball I observed "Roland Hall"
: <nobody@nowhere >
: > : >>: writing in news:uT******** ******@TK2MSFTN GP15.phx.gbl:
: > : >>:
: > : >>: > "Vinod" <vi***@erivasys tems.com> wrote in message
: > : >>: > news:%2******** ********@tk2msf tngp13.phx.gbl. ..
: > : >>: >: I have got a peculiar requirement. I want to distinquish
between
: > : >>: >: the color codes.
: > : >>: >:
: > : >>: >: I have got two text fields and i will enter the color codes
: there.
: > : >>: >: The first text field will have background color
: > : >>: >: The second will have text color.
: > : >>: >:
: > : >>: >: I want to validate if background color is dark then only light
: > : >>: >: colors should be entered in text.
: > : >>: >: and vice versa.
: > : >>: >:
: > : >>: >: any solutions will be great help.
: > : >>: >
: > : >>: > You can use the DOM on the client-side to determine what the
: > : >>: > current background color is but this is not an ASP issue.
: > : >>: >
: > : >>:
: > : >>: I don't think the OP wants that. I think he's saying if someone
: puts
: > : >>: # 000000 in one box, they can't put #666666 in the other box.
: > : >>: Color codes:
: > : >>: <http://webmonkey.wired .com/webmonkey/reference/color_codes/>
: > : >>
: > : >> I realize what he's asking for. He has to determine what the
: > : >> background color is so he can contrast the foreground color with
it.
: > : >> AND, it's a client-side issue, not an ASP one.
: > : >>
: > : >
: > : > Actually, we really don't know if it's client side or not.
: > : >
: > : ><% dim background
: > : > dim foreground
: > : > dim nocontrast
: > : >
: > : >
: > : > background = request.form("b ackground")
: > : > foreground = request.form("f oreground")
: > : >
: > : > 'some kind of function to determine whether the colors contrast
enough
: > : > if nocontrast = true then
: > : > response.write "There is not enough contrast"
: > : > end if
: > : > %>
: > : ><form method="post" action="">
: > : ><label for="background ">Backgroun d: </label>
: > : ><select name="backgroun d" id="background" >
: > : ><option value="000000" style="backgrou nd-color:#000;
: color:#fff">#00 0000
: > : ></option> <option value="c0c0c0" style="backgrou nd-color:#c0c0c0;
: > : > color:#fff">#c0 c0c0 </option> </select> <label
: > : > for="foreground ">Foregroun d:
: > : ></label> <select name="foregroun d" id="foregound" >
: > : ><option value="000000" style="backgrou nd-color:#000;
: color:#fff">#00 0000
: > : ></option> <option value="c0c0c0" style="backgrou nd-color:#c0c0c0;
: > : > color:#fff">#c0 c0c0 </option> </select>
: > : >
: > : ><input type="submit" value="Submit"> </form>
: > : >
: > : > Might be useful for someone trying to determine color blindness.
: > :
: > : The OP emailed me:
: > :
: > : >you got the problem right. I will tell the scenario also i am
building
: a
: > : >website where the users can choose there
: > : >own color combinations.so when the user selects a color and if it is
: > : >bright
: > : >color say he has selected the background color then the next
selection
: > : >should be
: > : >light color so that the combination looks good,
: > :
: > : I guess not everyone reads signatures.
: >
: > Not to mention he said, "the users can choose..." Can't do that from
the
: > server-side. The user selects a color and he wants to provide a
: contrasting
: > color for the foreground. The server doesn't need to see color is the
: point
: > I was trying to make nor can it determine what color the user chose
unless
: > it is posted. However, with his email to you, it appears he doesn't
want
: > any server-side. The user will be doing it on their end. How will they
: > read his message to them that the colors do not contrast? Perhaps he
will
: > use black/white, which he could just do anyway and eliminate the issue.
: >
: > If the user is selecting color contrast that is best for them, they can
do
: > that with their browser and override his settings. If they have trouble
: > seeing, they're most likely doing it already or they are using something
: > else to help them, like text-speech.
: >
: > --
: > Roland Hall
: > /* This information is distributed in the hope that it will be useful,
but
: > without any warranty; without even the implied warranty of
merchantability
: > or fitness for a particular purpose. */
: > Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
: > WSH 5.6 Documentation -
:
http://msdn.microsoft.com/downloads/list/webdev.asp
: > MSDN Library -
http://msdn.microsoft.com/library/default.asp
: >
: >
: I think you're still misinterpreting the OP's original intent. As I
: understand it, he has a form with two (2) text fields where the end user
can
: enter color codes (e.g. #FFFFFF, #000000, etc..). One for background, one
: for foreground. On the server-side, when these color codes are submitted,
: the difference between their brightness levels is calculated. If the
: difference is above a specified threshold, then the color code values are
: stored (perhaps in a database), if not the user is redirected to a page
that
: indicates there is insufficient contrast between the foreground and
: background colors specified. I don't think there's any client-side going
on
: in this scenario. I imagine this is for some skinning/personalization
: functionality on the website.
I'm willing to concede I'm missing it but I don't see how you get that out
of this statement:
"I want to validate if background color is dark then only light colors
should be entered in text. and vice versa."
"I want to validate if background is dark." Following your conclusion, the
value has already been selected.
"THEN only light colors should be entered in text." The user is entering
the text, or selecting from a list, but can only enter/select colors that
are in contrast with the background they have already chosen. To me, this
means the options have changed based on the first input and the webmaster
wants to be in control of those options, not the user.
"and vice versa." This means, to me, if background first, foreground
options are based upon that color. If foreground color is selected, then
background options are based upon that color.
His email to Adrienne, parallels what I just wrote.
you got the problem right. I will tell the scenario also i am building a
website where the users can choose there
own color combinations.so when the user selects a color and if it is
bright
color say he has selected the background color then the next selection
should be
light color so that the combination looks good,
This could be a simple list or numerous rectangles/squares on a page of the
color they selected with all of the available options for the contrasting
color for the text. The user could then select the one they want and THIS
could then be added to a database.
I think I've actually seen this somewhere before and it was done all
client-side. It could be done server-side but I think it would be a waste
to do so. We may have to agree to disagree on this one because I just can't
see his comments as anything else.
One last thing, why would the user be directed to a page informing them
their selections are inadequate for contrast? Who the Hell is looking at
this anyway? Isn't it the user? If it's their skinning/personalization
option, then why is the webmaster trying to decide for them? I think the OP
just wants to help the user choose the colors that work best together by
letting them know what the available color options are that would contrast
the most for a better viewing experience. However, I think the OP, while
offering these choices, should not only allow the user to choose a
predetermined pair but also choose any colors they want. Some may like
orange on red. Who am I to deny them that choice? Sounds like fish on
Fridays to me. (O:=
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp