[LON-CAPA-cvs] cvs: loncom /homework randomlylabel.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 23 Feb 2005 15:51:48 -0000


albertel		Wed Feb 23 10:51:48 2005 EDT

  Modified files:              
    /loncom/homework	randomlylabel.pm 
  Log:
  - allowing colors to start with # or x
  
  
Index: loncom/homework/randomlylabel.pm
diff -u loncom/homework/randomlylabel.pm:1.22 loncom/homework/randomlylabel.pm:1.23
--- loncom/homework/randomlylabel.pm:1.22	Wed Feb 23 10:48:54 2005
+++ loncom/homework/randomlylabel.pm	Wed Feb 23 10:51:48 2005
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # randomlabel.png: composite together text and images into 1 image
 #
-# $Id: randomlylabel.pm,v 1.22 2005/02/23 15:48:54 albertel Exp $
+# $Id: randomlylabel.pm,v 1.23 2005/02/23 15:51:48 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -237,6 +237,7 @@
 sub get_color_from_hexstring {
     my ($image,$color)=@_;
     if (!$color) { $color='000000'; }
+    $color=~s/^[x\#]//;
     my (undef,$red,undef,$green,undef,$blue)=split(/(..)/,$color);
     $red=hex($red);$green=hex($green);$blue=hex($blue);
     my $imcolor;