Here is another home grown bit of code that creates a color wheel.
<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.
*/
first = inputBaseN('00',16);
last = inputBaseN('FF',16);
interval = (last - first)/(url.steps);
value = first;
thelist = hexColor(value);
for (i=0; i LT url.steps; i = i + 1)
{
value = value + interval;
thelist = listAppend(thelist,hexColor(value));
}
//thelist = "00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,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>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318033
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4