Revision: 4719
http://sourceforge.net/p/vexi/code/4719
Author: clrg
Date: 2014-08-28 14:45:34 +0000 (Thu, 28 Aug 2014)
Log Message:
-----------
Return null if sending null colour to getReadableColor function
Modified Paths:
--------------
branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/util/color.t
Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/util/color.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/util/color.t
2014-08-28 14:43:41 UTC (rev 4718)
+++ branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/util/color.t
2014-08-28 14:45:34 UTC (rev 4719)
@@ -1,15 +1,16 @@
-<!-- Copyright 2009 - see COPYING for details [LGPL] -->
+<!-- Copyright 2014 - see COPYING for details [LGPL] -->
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta">
+<vexi xmlns:ui="vexi://ui"
+ xmlns:meta="vexi://meta">
+
<meta:doc>
- <author>Charles Goodwin</author>
<name>Color</name>
<desc>Utility functions for working with colors</desc>
</meta:doc>
- <ui:box>
+ <ui:Box>
fill ++= static.fillWrite;
- </ui:box>
+ </ui:Box>
/** assigns a textcolor that is readable against fill */
static.fillWrite = function(v) {
@@ -22,8 +23,12 @@
/** takes a string 'v' and parses it as a date for 'o' */
static.getReadableColor = function(c) {
+ // will set default on box
+ if (c == null) return null;
+ // look up from cache
var r = readable[c];
if (r) return r;
+
if (c.charAt(0)!='#') throw "Color must be in hex format";
r = vexi.string.parseInt(c.substring(1,3), 16)
+ vexi.string.parseInt(c.substring(3,5), 16)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn