File Exchange

image thumbnail


version 1.0 (3.71 KB) by

Convert colour names (blue,teal,pale green) into RGB triplets.

9 Ratings



View License

rgb(col) returns a Matlab RGB colour triplet [R G B] converted from 'col'.

'col' can be:
an [R G B] triplet (unchanged)
a colour name, e.g. 'pale orange'
a matlab colour char (k,r,...)
a QBASIC colour code (0-15)
a DWORD colour code (0-0xFFFFFF)
a DWORD BGR colour code

Comments and Ratings (11)

Mark Knecht

Works nicely. Thanks!

Paul Quelet

Excellent function! Works wonderfully!

Chad Greene

Chad Greene (view profile)

By coincidence, this function works with the rgbmap function described here:

Ofir Perry Bibi

paul harder


Matthew (view profile)

Thanks for writing this, I find it very handy and use it often when I write scripts to plot various measurement data.

lemes maykon

in my matlab no found the sistem RGB and HSI,how install this sistem? what do i do?

Alvaro Semedo

GAbriella Musacchia

This was very helpful!

Nick Williams

Just what I needed - the Matlab color space is large but it only allows limited navigation. This tool helps find your way around the colors much easier.

MATLAB Release
MATLAB 6.0 (R12)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today