What is nn#RRGGBB format?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chirs

    #1

    What is nn#RRGGBB format?

    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', 'buttonBorderOv er', 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

    #2
    Re: What is nn#RRGGBB format?


    "chirs" <yma@kicon.co m> schreef in bericht
    news:4c22a744.0 310281136.42e0d 2be@posting.goo gle.com...[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



    Comment

    • Lasse Reichstein Nielsen

      #3
      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/rasterTriangleD OM.html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      Working...