Generate maximally perceptually-distinct colors

Choose a set of n colors that can be readily distinguished from each other

Download
Download

You are now following this Submission

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Cite As

Tim Holy (2026). Generate maximally perceptually-distinct colors (https://se.mathworks.com/matlabcentral/fileexchange/29702-generate-maximally-perceptually-distinct-colors), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.2.0

As suggested by Il, I added the ability to avoid multiple background colors.

Download
1.1.0

I have added the option for the user to supply a function handle to any desired colorspace conversion function. One application is to use the file exchange's "colorspace" set of tools. In this case, you no longer need the image processing toolbox.

Download
1.0.0

Download