|
108 | 108 | colorbar.titlefont.family = ... |
109 | 109 | matlab2plotlyfont(colorbarTitleData.FontName); |
110 | 110 | col = round(255*colorbarTitleData.Color); |
111 | | - colorbar.titlefont.color = sprintf("rgb(%d,%d,%d)", col); |
| 111 | + colorbar.titlefont.color = getStringColor(col); |
112 | 112 | colorbar.titlefont.size = 1.20 * colorbarTitleData.FontSize; |
113 | 113 | elseif ~isempty(colorbarXLabelData.String) |
114 | 114 | colorbar.titleside = 'right'; |
115 | 115 | colorbar.titlefont.family = ... |
116 | 116 | matlab2plotlyfont(colorbarXLabelData.FontName); |
117 | 117 | col = round(255*colorbarXLabelData.Color); |
118 | | - colorbar.titlefont.color = sprintf("rgb(%d,%d,%d)", col); |
| 118 | + colorbar.titlefont.color = getStringColor(col); |
119 | 119 | colorbar.titlefont.size = 1.20 * colorbarXLabelData.FontSize; |
120 | 120 | elseif ~isempty(colorbarYLabelData.String) |
121 | 121 | colorbar.titleside = 'bottom'; |
122 | 122 | colorbar.titlefont.family = ... |
123 | 123 | matlab2plotlyfont(colorbarYLabelData.FontName); |
124 | 124 | col = round(255*colorbarYLabelData.Color); |
125 | | - colorbar.titlefont.color = sprintf("rgb(%d,%d,%d)", col); |
| 125 | + colorbar.titlefont.color = getStringColor(col); |
126 | 126 | colorbar.titlefont.size = 1.20 * colorbarYLabelData.FontSize; |
127 | 127 | end |
128 | 128 |
|
|
168 | 168 | end |
169 | 169 | end |
170 | 170 |
|
171 | | - colorbarColor = sprintf("rgb(%d,%d,%d)", col); |
| 171 | + colorbarColor = getStringColor(col); |
172 | 172 |
|
173 | 173 | colorbar.outlinecolor = colorbarColor; |
174 | 174 | colorbar.tickcolor = colorbarColor; |
|
283 | 283 | col = round(255*figureData.Color); |
284 | 284 | end |
285 | 285 |
|
286 | | - obj.layout.plot_bgcolor = sprintf("rgb(%d,%d,%d)", col); |
| 286 | + obj.layout.plot_bgcolor = getStringColor(col); |
287 | 287 | end |
288 | 288 |
|
289 | 289 | %-ASSOCIATED DATA-% |
|
301 | 301 | for n = 1:nticks-1 |
302 | 302 | col = 1-colorData(n); |
303 | 303 | colorscale{m} = {colorIndex(n), ... |
304 | | - sprintf("rgb(%d,%d,%d)", ... |
305 | | - round(255*[col, col, col]))}; |
| 304 | + getStringColor(round(255*[col, col, col]))}; |
306 | 305 | colorscale{m+1} = {colorIndex(n+1), ... |
307 | | - sprintf("rgb(%d,%d,%d)", ... |
308 | | - round(255*[col, col, col]))}; |
| 306 | + getStringColor(round(255*[col, col, col]))}; |
309 | 307 | m = 2*n+1; |
310 | 308 | end |
311 | 309 | obj.data{colorbarDataIndex}.marker.color = colorbarData.Ticks; |
|
0 commit comments