Connecting Tech Pros Worldwide Forums | Help | Site Map

What is nn#RRGGBB format?

chirs
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi,

The color is represented by #RRGGBB format. On a javascript sample,
it uses nn#RRGGBB format. What does nn mean? Here is the sample
codes:

(1)

var button = new ItemStyle(22, 1, '>', -15, 2, '10#006633',
'10#CC6600', 'buttonText', 'buttonHover',
'buttonBorder', 'buttonBorderOver', 80, 95, 'crosshair', 'default');

(2)

// For the colour fading, pull properties out of the nn#RRGGBB format
colours.
aI.timer = aI.count = 0;
aI.fade=[];
for(var i=0;i<2;i++)
{
// Set oC to the name of the property to check, either 'outCol' or
'overCol'.
var oC = i ? 'overCol' : 'outCol';
// The ItemStyle 'nn#RRGGBB' fading speed format: use a regex to
match it.
if (aI[oC].match(/^(\d+)\#(..)(..)(..)$/))
{
// Reset the outCol and overCol values to normal for the
div-writing routines.
aI[oC] = '#' + r.$2 + r.$3 + r.$4;
// Then store a subarray of fade speed and 3 hex colour calues if
detected.
aI.fade[i] = [r.$1, r.$2, r.$3, r.$4];
}
}

Janwillem Borleffs
Guest
 
Posts: n/a
#2: Jul 20 '05

re: What is nn#RRGGBB format?



"chirs" <yma@kicon.com> schreef in bericht
news:4c22a744.0310281136.42e0d2be@posting.google.c om...[color=blue]
> Hi,
>
> The color is represented by #RRGGBB format. On a javascript sample,
> it uses nn#RRGGBB format. What does nn mean? Here is the sample
> codes:
>[/color]

In the snippet, nn is matched with a regular expression to set the speed of
the fade effect achieved by the script.

In other words: it is specific for this script.


JW



Lasse Reichstein Nielsen
Guest
 
Posts: n/a
#3: Jul 20 '05

re: What is nn#RRGGBB format?


yma@kicon.com (chirs) writes:
[color=blue]
> The color is represented by #RRGGBB format. On a javascript sample,
> it uses nn#RRGGBB format. What does nn mean? Here is the sample
> codes:[/color]

Read the comments:
[color=blue]
> // The ItemStyle 'nn#RRGGBB' fading speed format: use a regex to
> match it.[/color]

It is used internally in the script. The nn appears to be the fading
speed.

/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Closed Thread


Similar JavaScript / Ajax / DHTML bytes