File Exchange

image thumbnail

colorStudioMax: ColorBrowser+dictio​nary, colorBlind correct

version 3.0.2 (5.17 MB) by Massimo Ciacci
Color Browser with dictionary, colorBlind correction & Philips Hue control

15 Downloads

Updated 09 Oct 2019

View License

Quick help: /screenshots/ColorStudioMax_HELP.jpg
Display Panels:
- Selected color : the current selected color, valid also for all other GUI panels.
- Closest name: closest entry in color dictionary csv file "color_codes.csv", containing 1147 color names and values.
The '<<' button makes the closest color the current selected color.
Display Control Panels
-----------------------
- HSV : two sections of HSV space, one at constant V (orthogonal to cilinder axis), one at constant H (parallel to cilinder axis)
- HSL : two sections of HSL space, one at constant L (orthogonal to cilinder axis), one at constant S (parallel to cilinder circular surface)
These four axis contain a draggable marker which will update on the fly the current selected color. The marker in HSL with constant S (right bottom axis) is instead updated upon release of the dragging. This choice was motivated by coexistence with the zoom functionality, accessible via the "+" "-" buttons below the axis.
RYB checkBox: changes the mapping of the displayed hue such that e.g. Yellow (H=60°) ends up at alfa = 120°. RYB has the advantage that complementary colors in the subtractive color space sense (paint) are at 180° from each other. Also I find RYB is a better representation for humans, when selecting color harmonies and color schemes.
Control UI TABBED panel : RGB|HSV|HSL, XYZ|xyY|Lab
-----------------------
TAB: RGB|HSV|HSL
A regular slider + edit box group per space, updated on the fly.
TAB: XYZ|xyY|Lab
A regular slider + edit box group per space, updated at the end of slider motion.
Since XYZ,xyY,Lab are not cartesian products, i.e. not all combinations of e.g. X,Y,Z are possible, when entering one of the 3 coordinates the others are changed accordingly if necessary, choosing the closest point in the color space. If the slider arrows are used, the slider will stop moving when out of the space. If the slider is clicked or dragged instead, or the edit box input is employed, the other coordinates are changed as necessary.
User Palette:
--------------
Each button has a state, 'busy' when displaying a color, 'free' when displaying a grey gradient.
A free button will store current color when left clicked.
A busy button will change the current color when left clicked.
A busy button will clear its content when right clicked.
Clear button : self explanatory
Save|Load : save|load current palette in a csv file using the hex RGB codes. Use the palette folder for this.
RGB primaries Palette:
---------------------
Similar to the User palette, but non erasable.
Right click on white resets the GUI
Color Scheme Panel
------------------
- Color Wheel : a set of 12 colors, equidistant in RYB hue, spaced by 30° RYB degrees.
The color wheel is updated such that the current color is always present, marked by a filled circle.
Saturation and Value of all entries is constant and equal to that of the selected color.
Each patch is clickable and changes the current selection.
- Color Scheme Selector (at the bottom): one of the following
'Complementary',... % H0, H0+180
'Split Complementary', ... % H0, H0+150, H0-150
'Analogous',... % H0, H0-30,H0+30
'Accented analogous', ... % H0, H0-30,H0+30, H0+180
'Triadic', ... % H0, H0+120, H0-120
'Rectangle',... % H0, H0-30, H0+180, H0+150
'Square',... % H0, H0+90, H0+180, H0-90
where H0 is the RYB hue of the current selected color.
see also
https://en.wikipedia.org/wiki/Color_scheme
- Color Patches : Represent the current color scheme
- B/W checkbox : change the background of the color scheme to black or white
- Color-Blind Popup (Display Mode) : Modify the display of color scheme, wheel and palette buttons color to correct/simulate Deuternaomalous color blind vision :
'normal mode' : no modification, normal vision
'deuteranomalous correction 1' : R/G Equalize for color blind viewer, setting = weak
'deuteranomalous correction 2' : R/G Equalize for color blind viewer, setting = medium
'deuteranomalous correction 3' : R/G Equalize for color blind viewer, setting = strong
'deuteranomalous simulation 1' : Distort for normal viewer setting R/G color blind weak
'deuteranomalous simulation 2' : Distort for normal viewer setting R/G color blind medium
'deuteranomalous simulation 3' : Distort for normal viewer setting R/G color blind strong
Try load palette: "palettes\_ColorBlind_Identical_Pairs_Deuteranopus.csv"
which contains three pairs of nearly undistiguishable colors: AABBCC
and see the effect of the above corrections.
see ColorGUI_v1_0\screenShots\color-blind\ for examples
see ColorGUI_v1_0\tools\colorblind\ for implementation. In particular run test_Deblinder_Hue_LUT to see the effect on the Ishihara color blind tables (if you are a red-green 'moderate' color blind, i.e. "Deuteranomalous")
see Deblinder_Hue_LUT.m header text for more details.

Cite As

Massimo Ciacci (2019). colorStudioMax: ColorBrowser+dictionary, colorBlind correct (https://www.mathworks.com/matlabcentral/fileexchange/61775-colorstudiomax-colorbrowser-dictionary-colorblind-correct), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (13)

Previous version was unusable beyond ML2014b, due to this error:

Error using matlab.graphics.axis.Axes/set
While setting property 'PlotBoxAspectRatio' of class 'Axes':
Input values must be positive finite numbers.
Error in axis>LocSetEqual (line 411)
set(ax,'PlotBoxAspectRatio', ...

Error in axis (line 157)
LocSetEqual(ax(j),pbarlimit);

Error in ColorStudioMax_XT>make_ax_HSV_const_V (line 548)
axis(axH,'equal');

ROOT CAUSE: getpixelposition in "axis equal" returned 0's, since the axis was on a non plotted panel.
FIX: create uipanel with fontunits points, and only afterwards set to normalized. Which is actually safer and more logical for any uicontrol...

For those who will eventually try this out, remember to give a shot to the sorting a color palettes! It is a fancy feature I keep coming back to, I use it to loop through palette colors in Philips lightstrip in the evening with an interval of about 2-3 seconds.

Thanks for the rating AJ, much appreciated :)!

To show a gradient on a plot you need to have a matrix of colors as CData, and use the patch command. You can type "doc patch" to see Matlab examples using CData to define colors.

In the GUI you can check for example the function "make_Upd_HSV_H_square", where the patch is created as

patch('Vertices',vmSV,'Faces',fm, 'FaceVertexCData',vmRGB01,'FaceColor','interp','EdgeColor','none');

- vmSV is a Nx2 matrix of x,y vertex coordinates (N grid vertexes),
- fm is a Mx4 matrix of indexes of the vertexes, so each row defines a rectangle (M rectangles),
- vmRGB01 is Nx3 where each row is an r,g,b triple specifying the color of that vertex.

AJ Geiger

Great GUI! how did you get the gradient to display in the axes?

v1.7 : I forgot to mention that there are now two possible mains, normal (ColorStudioMax.m, 4 panels) and extended (ColorStudioMax_XT.m, 6 panels).

@Stephen Cobeldick, thanks for your comment, really appreciated :). This tool took me indeed quite some time. The color distance is still not accurate, it uses a mix of Lab and HSV, since only Lab tends to not give importance to saturation distance. However I will soon release an update about this which should resolve a current problem with H around 0 (I need to convert HSV to cartesian before including the HSV distance in the total, else I have a discontinuity @ H=0).

@Massimo Ciacci: impressive! You have obviously put in a large amount of effort into this.

Question: what colorspace/deltaE is used for identifying the closest colorname?

Yee Jack

Awesome! It's works now. Thanks again!

Thank you Yee Jack! I fixed the csv table, which indeed showed an extra space in line 902. but I could not test if there are any other issues on Matlab2012a, since I do not have it. As soon as I get to test this on other ML versions, I will make an update.

Yee Jack

First of all, Thanks to the author's selfless sharing, This' s a great work!
I tried to run the function ColorStudioMax_v1_0 in MATLAB 2012a. It gives me error too...
like this:
>> ColorStudioMax_v1_0

starting GUI...

TwoColumnString =

Rebecca Purple�#663399

ii =

902

错误使用 getColorTable (line 25)
above line wrong in csv file

出错 findClosestColorToGivenRGB_Lab_Metric (line 31)
[rVec,gVec,bVec,colorNameStrings,N,colorNameCells_] = getColorTable(inputFile_csv);

出错 ColorStudioMax_v1_0>getClosestColorData (line 1028)
[~, RGBint_closest, dist,~,ColIdx,colorNameCells,colorListRGBint] =
findClosestColorToGivenRGB_Lab_Metric(RGBint);

出错 ColorStudioMax_v1_0>make_ax_Closest_Col (line 467)
[colDataStr, ColIdx, RGBint_closest, colorNameCells,colorListRGBint] =
getClosestColorData(RGBint);

出错 ColorStudioMax_v1_0 (line 131)
[dictionary] = make_ax_Closest_Col(ax4, RGBint_start, posAx4Pix, fsz);

We look forward to seeing the updated version as soon as possible.

Abhay, thanks for your comment. Unfortunately I do not have Matlab 2016b, this was tested on 2014b.
The type of error you describe is pretty cryptic, I can't see how an inoocent "axis equal" can fire such an error. If I get the chance to hunt it down you will hear from me.

Abhay Nayak

I tried to run the function ColorStudioMax_v1_0 in MATLAB 2016b. It gives me the following error
>> ColorStudioMax_v1_0

starting GUI...

Error using matlab.graphics.axis.Axes/set
While setting property 'PlotBoxAspectRatio' of class 'Axes':
Input values must be positive finite numbers.

Error in axis>LocSetEqual (line 411)
set(ax,'PlotBoxAspectRatio', ...

Error in axis (line 157)
LocSetEqual(ax(j),pbarlimit);

Error in ColorStudioMax_v1_0>make_ax_HSV_const_V (line 363)
axis(axH,'equal');

Error in ColorStudioMax_v1_0 (line 152)
[h_HSVV] = make_ax_HSV_const_V(ax2, RGBint_start, RYB_MAP_initVal);

Tested on Matlab 2011a and 2014b.

Updates

3.0.2

The small version of the GUI had one bug loading palettes.

3.0.1

just had forgot to update "created with" field

3.0.0

(1) Updated for ML2016b which was crashing
- panels created with FontUnits points, then set to normalized else half GUI doesn't show
(2) Correct scaling of GUI upon changing the startup resolution

2.4.0.0

- Updated Philips Hue Driver to list available lamps

2.3.0.0

Added a "close function" which turns off the lights before closing the GUI (XT version only). Also the XT version of the GUI only closes via its 'x' button, not when one types close all in the console.

2.2.0.0

Improved color sorting, with choice of color space for sorting.

2.1.0.0

Updated screenshot to show the wheel with one of the colorblind corrections

2.1.0.0

1) Fixed a bug in ColorStudioMax_XT, clicking on HSV(S) plane
2) make_WheelAndSchemePatches.m has a new switch "COLORSCHEME_IS_CLICKABLE"
3) XT version of the GUI will now only close on close all force.

2.0.0.0

Philips_HUE_CONNECT.m is updated.
Hue bridge setup issue fixed.
While connecting to https://www.meethue.com/api/nupnp
"The server returned the message: "sun.security.validator.ValidatorException: PKIX path building failed"
see also readme.txt

1.9.0.0

- color dictionary now has 1152 color entries
- startup : set visible after zoomed
- Palette init : at startup palette START.csv is loaded, overwrite it with your favourite palette

1.8.0.0

Improve color distance: findClosestColorToGivenRGB_Lab_Metric, balanced weights, and less priority to saturation
Color Dictionary : 3 new entries. Total Named Colors = 1150.

1.7.0.0

screen shot

1.7.0.0

ooops! I had only updated the screenshot ! Sorry for the inconvenience..

Launch "ColorStudioMax_XT.m" for 6 panel mode as in the screenshot, ColorStudioMax for 4 panel mode (previous version).

1.7.0.0

Added two more color picker spaces: HV of HSV and SL of HSL. Now there are six picker planes
HSV : HS, HV, SV (new)
HSL : HS, HL (new), SL
Especially the new SV picker is a useful addition, more pleasant than SL to work with.

1.6.0.0

findClosestColorToGivenRGB_Lab_Metric Mode 4 (Lab-HSLcart, 66%-33%) uses now cartesian HSL, wrap@ H=360 fixed.
Added screenshot about PHUE RGB-2-xy: showing how RGB-XYZ-xyY is stretched to meet the PHUE corners
(In set_Lamp_RGB.m default GAMUT=C)

1.5.0.0

- Cleaned up some unused code
- Added a few PHUE palettes nice to loop with, in particular, PHUE_Blues_1 is my favourite study palette. Wheel_24 palettes are a bit too flashy, but nice to show off your leds to friends.

1.5.0.0

- Added sorting of Color Palette, based on a 3D Travelling Salesman Problem. This is handy especially when looping colors with Philis Hue Led lights, to minimize color discontinuities.

1.4.0.0

updated screen shot

1.4.0.0

Added A loop feature, which goes through all current palette colors. Useful after connecting with Philips Hue Lamp, to create any desired color sequence, with the aid of "load palette and" "save palette". See e.g., PHUE_cool2.csv.

1.3.0.0

- Updated Hue driver to v1.3
- Added 2 color palettes, PHUE_cool , PHUE_warm

1.2.0.0

add one cross link

1.2.0.0

- shorter file, smaller screenshots

1.2.0.0

forgot to update name

1.2.0.0

Major improvement of usability: while picking the color you will see the Philips hue lamp following you in real time... :)!
Have a look at the screen shot. To launch simply start ColorStudioMax, and have fun !

1.1.0.0

screen shot

1.1.0.0

- csv color table had one offending space (not visible in 2014b)
- color de-blinder tables were tweaked to my vision in March, had not been uploaded until now
- updated screen-shot with some quick-help words

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: draggable, Philips Hue Matlab Driver

ColorGUI_v3_0

ColorGUI_v3_0/Philips_HUE_ML_Driver_v1_4

ColorGUI_v3_0/Philips_HUE_ML_Driver_v1_4/PHUE_Connect

ColorGUI_v3_0/Philips_HUE_ML_Driver_v1_4/PHUE_Connect/BridgeTools

ColorGUI_v3_0/Philips_HUE_ML_Driver_v1_4/PHUE_Connect/BridgeTools/convert

ColorGUI_v3_0/Philips_HUE_ML_Driver_v1_4/PHUE_Connect/BridgeTools/convert/calc_XYZ_sRGB_MatrixForTriangleGamut

ColorGUI_v3_0/Philips_HUE_ML_Driver_v1_4/PHUE_Connect/BridgeTools/urlread2

ColorGUI_v3_0/tools

ColorGUI_v3_0/tools/Plots

ColorGUI_v3_0/tools/Plots/patchObjectColor

ColorGUI_v3_0/tools/UI

ColorGUI_v3_0/tools/colorblind

ColorGUI_v3_0/tools/conversions

ColorGUI_v3_0/tools/dictionary

ColorGUI_v3_0/tools/geometric

ColorGUI_v3_0/tools/geometric/TSP3D