色标 [英] Color Code
问题描述
我有一个特殊的要求。我想区分颜色
代码。
我有两个文本字段,我将在那里输入颜色代码。
第一个文本字段将具有背景颜色
第二个文本字段将具有文本颜色。
我想验证背景颜色是否较暗然后只有浅色应该用文本输入
。
,反之亦然。
任何解决方案都会有很大的帮助。
< br $>
问候
vinod
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
推荐答案
" Vinod" < 6 *** @ erivasystems.com>在留言中写道
新闻:%2 **************** @ tk2msftngp13.phx.gbl ...
:我有一个特殊的要求。我想区分颜色
:代码。
:
:我有两个文本字段,我将在那里输入颜色代码。
:第一个文本字段将具有背景颜色
:第二个文本字段将具有文本颜色。
:
:我想验证背景颜色是否暗,然后只有浅色
应该
:输入文字。
:反之亦然。
:
:任何解决方案都会有很大的帮助。
您可以在客户端使用DOM来确定目前
背景颜色是什么,但这不是ASP问题。
-
Roland Hall
/ *这些信息的分发是希望它有用,但
没有任何保证;甚至没有适销性的暗示保证
或特定用途的适用性。 * /
Technet脚本中心 - http:// www .microsoft.com / technet / scriptcenter /
WSH 5.6文档 - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
"Vinod" <vi***@erivasystems.com> wrote in message
news:%2****************@tk2msftngp13.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
注视着我的水晶球,我观察到Roland Hall。 < nobody @ nowhere>
写新闻:uT ************** @ TK2MSFTNGP15.phx.gbl:
Gazing into my crystal ball I observed "Roland Hall" <nobody@nowhere>
writing in news:uT**************@TK2MSFTNGP15.phx.gbl:
Vinod < 6 *** @ erivasystems.com>在消息中写道
新闻:%2 **************** @ tk2msftngp13.phx.gbl ...
:我有一个特殊的要求。我想区分
:颜色代码。
:
:我有两个文本字段,我将在那里输入颜色代码。
:第一个文本字段将有背景颜色
:第二种颜色有文字颜色。
:
:我想验证背景颜色是否暗,然后只有浅色
:应该输入文字。
:反之亦然。
:
:任何解决方案都会有很大的帮助。
你可以在客户端使用DOM来确定当前的什么>背景颜色但这不是ASP问题。
"Vinod" <vi***@erivasystems.com> wrote in message
news:%2****************@tk2msftngp13.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.
我不认为OP想要这样。我想他说如果有人把#
000000放在一个盒子里,他们就不能把#666666放在另一个盒子里。
颜色代码:< http://webmonkey.wired.com/webmonkey/reference/color_codes/>
-
Adrienne Boswell
http://www.cavalcade-of-coding.info
请回复小组以便其他人分享
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
" Vinod" < 6 *** @ erivasystems.com>写在留言中
新闻:%2 **************** @ tk2msftngp13.phx.gbl ...
"Vinod" <vi***@erivasystems.com> wrote in message
news:%2****************@tk2msftngp13.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.
人眼的颜色***亮度由
29.9%红色,58.7%绿色和11.4组成%blue
所以,对于网页颜色,
(3 *红色)+(6 *绿色)+蓝色会给你一个近似值亮度
介于0到2550之间
选择一个门槛(例如1200)
然后背景颜色< 1200是黑暗的,需要一个明亮的前景,
和背景颜色> = 1200很轻,需要一个黑暗的前景。
***成为少数几个优点之一一个美国的英语程序员
占主导地位
世界,我总是可以使用''color''作为标识符 - 没有任何恐惧
这是一个
保留字。
-
roger
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
>
这篇关于色标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!