classdef LnColor

  enumeration  
    r  % (1,0,0)
    g  % (0,1,0)
    b  % (0,0,0)
    k  % (0,0,0)
    w  % (1,1,1)
    y  % (1,1,0)
    m  % (1,0,1)
    c  % (0,1,1)
  end
   
  methods (Static) 
    
    % LineStyle für Graphic Handle obj setzen
    function set( obj, col )
      if( ~isMatlabHandle(obj) ) return; end
      % Zahlen direkt übergeben
      if( length(col) == 3    && ...
          isnumeric( col(1) ) && ... 
          isnumeric( col(2) ) && ... 
          isnumeric( col(3) ) )
        val = col;
      else
        val = [1,1,1];
        switch( col )
          case { LnColor.r, 'r' }
            val = [1,0,0];
          case { LnColor.g, 'g' }
            val = [0,1,0];
          case { LnColor.b, 'b' }
            val = [0,0,1];
          case { LnColor.k, 'k' }
            val = [0,0,0];
          case { LnColor.w, 'w' }
            val = [1,1,1];
          case { LnColor.y, 'y' }
            val = [1,1,0];
          case { LnColor.m, 'm' }
            val = [1,0,1];
          case { LnColor.c, 'c' }
            val = [0,1,1];
          otherwise
            return;
        end  
      end
      % Color am Objekt setzen 
      set( obj, 'Color', val );
    end 
    
  end  % methods (Static)     
end 