X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fpickcolor.html;fp=httemplate%2Felements%2Fpickcolor.html;h=d410ebfc7a68623b8ddf8ce133a0edb6c37c90bf;hb=a98cd4637716d783c20bb08d903978d06abf9d31;hp=0000000000000000000000000000000000000000;hpb=556b8e9650155e74416496238cfc0e4abe64c53a;p=freeside.git
diff --git a/httemplate/elements/pickcolor.html b/httemplate/elements/pickcolor.html
new file mode 100644
index 000000000..d410ebfc7
--- /dev/null
+++ b/httemplate/elements/pickcolor.html
@@ -0,0 +1,60 @@
+
+
+
+% for (1..$rows) {
+
+% for (1..$cols) {
+% last unless @colors;
+% my $color = shift(@colors);
+ |
+% }
+
+% }
+
+
+<%init>
+
+my %opt = @_;
+
+my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
+
+my $unum = int(rand(100000));
+
+my $id = $opt{'id'} || $opt{'field'}.$unum;
+
+my @colors = (
+ '', #none/white
+ 'FF6666', #red
+ 'FF9966', #orange
+ 'FFFF66', #yellow
+ '66FF66', #green
+ '66FFFF', #cyan?
+ '6666FF', #blue
+ 'CC66FF', #purple? FF66FF looks more like pink.
+);
+
+my $rows = 2;
+
+my $cols = int(.5+scalar(@colors)/$rows);
+
+%init>