I do not think any limit is respected by Matlab. RGB and HSV colors can also be doubled - this gives you an “almost infinite” number of colors (as well as gray).
Graphics windows are made in Java. There, the color can be determined by four floats (see Color ) - leaving you still with more colors than the hardware can handle.
Reference:
The actual color used in rendering depends on finding the best match, given the color space available for a particular output device.
Thus, ultimately it depends on your equipment.
source share