![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176513/image.png)
Is there a color database existent?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Is there a simple color database existent containing a bunch of RGB colors which I could use in my script to create colored images?
e.g. I'd like to be able to do this
image(LG) %%-> selects LG from database which gives a light green image
0 commentaires
Réponse acceptée
Stephen23
le 26 Mai 2017
Modifié(e) : Stephen23
le 26 Mai 2017
Download my FEX submission colornames:
then simply create an array using those colors, and show that using image or imshow:
>> [~,rgb] = colornames('SVG','LightGreen');
>> A = reshape(rgb,1,1,3)
>> image(A)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176513/image.png)
Note that colornames supports many common color palettes, yet is very simple to use:
[clr,rgb] = colornames('HTML4','blue','red','teal','olive')
clr =
'Blue'
'Red'
'Teal'
'Olive'
rgb =
0 0 1
1 0 0
0 0.50196 0.50196
0.50196 0.50196 0
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!