Rick if you use this loop solution it will produce the colors in the proper 
order.  (Generating this code was the purpose of this thread.)

<cfscript>
/*
Create sequence of color hues.

Thanks to Jim Wright of the House of Fusion discussion list for his invaluable 
assistance in creating this algorithm. */

thelist = "00,33,66,99,CC,FF"; //Do this to seed the list with values, by 
default the first element is the last value in the list, and all of the others 
are the first value in the list, could also be set manually

y = -1; //The direction we are starting in the list
x = 2; //The position we are starting with
p = 3; //Number of columns
colorList = "";

p1 = listlast(thelist);
for (lp = 2; lp LTE p; lp = lp + 1)
  variables["p" & lp] = listfirst(thelist);

l = listfind(thelist,variables["p" & x]);

//Create hex value for current Hue
hex = "";
for (lp = 1; lp LTE p; lp = lp + 1)
  hex = hex & variables["p" & lp];

colorList = listAppend(colorList, hex);

do //iterate until start value is returned.
{
  while (((y LT 0 AND l IS 1) OR (y GT 0 AND l IS listlen(thelist))))
  {
  y = y * -1;

  if (x EQ 1)
    x = p;
  else
    x = x - 1;

  l = listfind(thelist,variables["p#x#"]);
  }

  l = l + y;
  variables["p" & x] = listgetat(thelist,l);

  //Create hex value for current Hue
  hex = "";
  for (lp = 1; lp LTE p; lp = lp + 1)
    hex = hex & variables["p" & lp];

  colorList = listAppend(colorList, hex);
} while (listFirst(colorList) NEQ hex);

colorList = listDeleteAt(colorList,listLen(colorList));// remove repeat of 
first value. </cfscript>


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262095
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to