473,805 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Color Code

Hi,

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.

regards
vinod
Jul 22 '05 #1
19 3253
"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.

--
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
Jul 22 '05 #2
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/>

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #3

"Vinod" <vi***@erivasys tems.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

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.


The brightness of a colour*** to human eyes is made up of

29.9% red, 58.7% green and 11.4% blue

so, for web colours,

(3 * red) + (6 * green) + blue will give you an approximate brightness
between 0 and 2550

Choose a threshold (e.g. 1200)

then background colours < 1200 are dark and need a light foreground,
and background colours >= 1200 are light and need a dark foreground.
*** One of the few advantages of being an English programmer in a US
dominated
world, is that I can always use 'colour' as an identifier - without any fear
that it is a
reserved word.

--
roger
Jul 22 '05 #4
"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.

--
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
Jul 22 '05 #5
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.
--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #6
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.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #7
"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
Jul 22 '05 #8

"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.
Jul 22 '05 #9
"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
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5078
by: Richard A. DeVenezia | last post by:
I hope this is the end of my present 'discovery' phase. I've learned alot about JavaScript in a short time and my head hurts. The following is what came out of all my questions and all the excellent answers (thanks!). It will be the basis of a slightly more complicated function for rendering a two-level navigation bar ( Don't have time to get into design of a multi-styletype renderer for n-level hierarchies. ) This is a single function...
3
1707
by: Mickey | last post by:
Hi, I am having trouble with a javascript. The purpose of this script is to enable a user to click a generated color cell in a table and the color code ie: #ffffff is returned to the caller... ie: printed in a textfield on the calling page/form. Presently, in Firefox.. this script will print the shell of a table (just the borders...) and in IE I get nothing.
4
1859
by: Sharon | last post by:
Hi guys I don't understand what I am doing wrong I wrote this code, in order to manipulate some Xml data, I have problem with level 4 (properties section): //CODE -----------------------------------------------------------------------------------------------------------------------------------------
6
5012
by: Jerry J | last post by:
Is there a way to change the background color of a web form on the server before it is posted? In the pageLoad event I can do it to server controls by adding an attribute, however, how do I do the same for the page's background color? Should be simple I think? Jerry J
6
1936
by: Mark | last post by:
Hello all - I'm trying to incorporate a stylesheet into an ASP.Net page but everytime I include the "LINK" code to the .css file in the HEADER location of the HTML code, the background color that I have set (which is blue) gets changed to white. Below is my code in the HTML of the ASP.NET page and then my code in the .css file. Any help is sincerely appreciated as I haven't worked with stylesheets alot in my past. Thanks for any...
36
2488
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other applications. In the end all I want to do is form1.backcolor = system.whatever.color
31
7248
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
5
4704
by: hayworth | last post by:
How do I get the color depth of the screen/display adapter with vb.net 2003? Background: We're having transparency problems (long side story and known Windows "bug") that requires our systems to have the Color Depth or "Color Quality" (bits per pixel) of the display adapter (screen) to be 16 bits (Called "Medium (16 bit)" in the Display Properties Control Panel) in order for it to work.
4
3379
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.