changeset 436:51d818bc8915

Add a vector of all colors to Color
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 21 Feb 2017 16:40:55 +0100
parents 0bc37a25ed88
children b0361f203492 2663be328d9a c6d03f951a7f
files Color.m
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Color.m	Fri Feb 17 15:08:25 2017 +0100
+++ b/Color.m	Tue Feb 21 16:40:55 2017 +0100
@@ -9,6 +9,7 @@
         darkred   = [0.635 0.078 0.184];
         black     = [0.000 0.000 0.000];
         white     = [1.000 1.000 1.000];
+        colors = { Color.blue, Color.red, Color.yellow, Color.green, Color.purple, Color.lightblue, Color.darkred, Color.black, Color.white};
     end
 
     methods(Static)
@@ -16,7 +17,6 @@
             markers ={'+', 'o', '*', '.', 'x', 'square', 'diamond', 'v', '^', '>', '<', 'pentagram', 'hexagram'};
             % Filled and non-filled markers?
             lineStyles = {'-', '--', ':', '-.'};
-            colors = { Color.blue, Color.red, Color.yellow, Color.purple, Color.green, Color.lightblue, Color.darkred, Color.black, Color.white};
 
 
             function showMarkers(x0, y0, lx, ly, color, filled)
@@ -41,7 +41,7 @@
             end
 
             function showColors(x0, y0, lx, ly)
-                n = length(colors);
+                n = length(Color.colors);
                 s = ceil(sqrt(n));
 
                 x = linspace(x0, x0 + lx, s);
@@ -52,8 +52,8 @@
                 for i = 1:n
                     lh = line(X(i),Y(i));
                     lh.Marker = 'o';
-                    lh.MarkerFaceColor = colors{i};
-                    lh.Color = colors{i};
+                    lh.MarkerFaceColor = Color.colors{i};
+                    lh.Color = Color.colors{i};
                     lh.MarkerSize = 12;
                 end
             end