Unverified Commit 4e73e2fa authored by jayd1860's avatar jayd1860 Committed by GitHub
Browse files

Merge pull request #23 from BUNPC/more-colors-from-csv

More colors, more channels for data view, programmable via a .csv file.
parents 1cdc7bae 213e4b27
Loading
Loading
Loading
Loading
+33 −22
Original line number Diff line number Diff line
function axesSDG = InitAxesSDG(handles)

axesSDG = struct(...
                 'handles', struct(...
                                   'axes', handles.axesSDG, ...
                                   'SD', [], ...
                                   'ch', [] ...
                                  ), ...
                 'iCh', [], ...
                 'iSrcDet', [], ...
                 'linecolor', [...
default_colors = [...
    0.2  0.6  0.1;
    1.0  0.5  0.0;
    1.0  0.0  1.0;
@@ -24,10 +16,29 @@ axesSDG = struct(...
    0.4  0.4  0.4;
    0.6  0.6  0.6;
    0.8  0.8  0.8 ...
                              ] ...
               );

];

% additional_colors = rand_seeded(345,10,3);
% axesSDG.linecolor(end+1:end+size(additional_colors,1),:) = additional_colors;
p = [getAppDir(), 'SDGcolors.csv'];
try
    rgb01 = csvread(p) / 255;
    if size(rgb01, 1) < 6
    rgb01 = default_colors
    fprintf(['SDGcolors.csv is not an appropriate table of more than 6 RGB values. Using default colors.\n'])
    else
        fprintf(['Loaded ', num2str(size(rgb01, 1)), ' colors from SDGcolors.csv.\n']) 
    end
catch  % File not found
    rgb01 = default_colors;
    fprintf(['Failed to load SDGcolors.csv. Using default colors.\n']) 
end

axesSDG = struct(...
                 'handles', struct(...
                                   'axes', handles.axesSDG, ...
                                   'SD', [], ...
                                   'ch', [] ...
                                  ), ...
                 'iCh', [], ...
                 'iSrcDet', [], ...
                 'linecolor', rgb01...
               );

SDGcolors.csv

0 → 100644
+77 −0
Original line number Diff line number Diff line
51,153,25
255,127,0
255,0,255
127,127,255
0,255,255
255,0,0
51,76,25
204,153,153
127,255,127
127,255,255
0,0,0
51,51,51
102,102,102
153,153,153
204,204,204
152,109,92
131,46,208
80,199,65
64,64,209
155,187,55
214,73,222
87,161,67
144,95,232
205,170,60
76,40,154
225,135,47
76,107,224
222,72,42
67,187,206
225,55,90
86,193,144
159,52,171
56,97,33
221,59,164
66,131,86
220,120,217
140,133,45
42,29,107
156,181,114
115,45,131
210,168,123
82,80,164
160,96,42
88,136,220
152,49,35
120,174,221
193,57,107
135,180,172
144,40,106
67,119,111
161,115,217
102,85,31
164,149,218
38,61,38
229,125,177
16,35,39
228,138,103
41,33,74
215,105,106
30,52,70
205,155,161
76,27,85
147,146,112
163,94,162
64,46,28
185,151,189
55,23,28
92,132,160
106,41,36
67,88,144
98,92,68
92,26,59
,,
,,
,,
,,
,,