ColorBlindSets
GETCOLORSET : Color Blind Friendly Color Sets
[ cMat, cStruct, cNames, colorCell] = getColorSet( NColors , PaletteSize, skipGray)
Helps you choose a palette of color blind friendly colors
The palette choice is such as to attempt best discriminability by a deuteranopus
color blind as long as PaletteSize(PaletteSize) <= 14
1) assigns colors to [cMat, cStruct]
2) sets defaultAxesColorOrder accordingly for use with hold all
3) Returns a list [ cNames, colorCel] of NColors,
where PaletteSize colors are repeated to fill up required NColors size
NColors : size(cMat,1) = numel(cNames) --> number of curves that will be plotted on top
PaletteSize : how many different colors are there
PaletteSize : 1..27
----------
<= 11 Color Blind Safe % SMALL
12..15 Color Blind okeish % MEDIUM
16..19 Color Blind challenging % LARGE
20..26 Color Blind unfriendly % Too Large
Four possible color addressing modes :
------------------------------------
(1) automatic
hold all; plot(..); Use defaultAxesColorOrder colors, set by this function
(2) cell Array
plot( ,'color', colorCell{idx}) Cell Array
(3) matrix row
plot(...,'color', cMat(idx,:)) Matrix Row
(4) struct name with color name field
plot(...,'color', cStruct.SpringGreen) Color Name
EXAMPLE, Using Defaults
=======
N = 15; %number of curves
[ cMat, cStruct] = getColorSet(); %use best defaults for color blind viewer
figure(123); hold all;
for idx = 1:N
plot([0,1],N+1-[idx,idx], 'linewidth',6)
end
EXAMPLE
=======
N = 10;
[ cMat, cStruct, cNames] = getColorSet(N);
figure(123); hold on;
for idx = 1:N
plot([0,1],[idx,idx],'color',colorCell{idx}, 'DisplayName',cNames{idx}, 'linewidth',6)
end
leg = legend(gca,'-DynamicLegend');
legend(gca,'show');
Citar como
Massimo Ciacci (2025). ColorBlindSets (https://www.mathworks.com/matlabcentral/fileexchange/65163-colorblindsets), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
- Image Processing and Computer Vision > Image Processing Toolbox > Image Segmentation and Analysis > Region and Image Properties >
Etiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
ColorBlindSets_v1_0/
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.0.0 |