Home > SuperSegger > viz > getRGBColor.m

getRGBColor

PURPOSE ^

getRGBColor : returns rgb value of color name.

SYNOPSIS ^

function colorRBG = getRGBColor( color_name )

DESCRIPTION ^

 getRGBColor : returns rgb value of color name.

 INPUT :
   color_name : string with initial for color name {'r','g','b','o','c','y'}
 OUTPUT :
   colorRBG : color rgb value

 Copyright (C) 2016 Wiggins Lab 
 Written by Stella Stylianidou.
 University of Washington, 2016
 This file is part of SuperSegger.
 
 SuperSegger is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 SuperSegger is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function colorRBG = getRGBColor( color_name )
0002 % getRGBColor : returns rgb value of color name.
0003 %
0004 % INPUT :
0005 %   color_name : string with initial for color name {'r','g','b','o','c','y'}
0006 % OUTPUT :
0007 %   colorRBG : color rgb value
0008 %
0009 % Copyright (C) 2016 Wiggins Lab
0010 % Written by Stella Stylianidou.
0011 % University of Washington, 2016
0012 % This file is part of SuperSegger.
0013 %
0014 % SuperSegger is free software: you can redistribute it and/or modify
0015 % it under the terms of the GNU General Public License as published by
0016 % the Free Software Foundation, either version 3 of the License, or
0017 % (at your option) any later version.
0018 %
0019 % SuperSegger is distributed in the hope that it will be useful,
0020 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0021 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0022 % GNU General Public License for more details.
0023 %
0024 % You should have received a copy of the GNU General Public License
0025 % along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.
0026 
0027 
0028 cyan_col = [0,255,255]/255;
0029 orange_col = [255,165,0]/255;
0030 red_col = [255,0,0]/255;
0031 green_col = [0,255,0]/255;
0032 blue_col = [0,0,255]/255;
0033 yellow_col = [255,255,0]/255;
0034 
0035 
0036 if color_name == 'r'
0037     colorRBG = red_col;
0038 elseif color_name == 'c'
0039     colorRBG = cyan_col;
0040 elseif color_name == 'y'
0041     colorRBG = yellow_col;
0042 elseif color_name == 'b'
0043     colorRBG = blue_col;
0044 elseif color_name == 'o'
0045     colorRBG = orange_col;
0046 elseif color_name == 'g'
0047     colorRBG = green_col;
0048 else
0049     disp ('color not found');
0050 end
0051 
0052 
0053 end
0054 
0055

Generated on Thu 19-Jan-2017 13:55:21 by m2html © 2005