View License

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

» Watch video

Highlights from

4.9 | 9 ratings Rate this file 28 Downloads (last 30 days) File Size: 3.71 KB File ID: #1805 Version: 1.0



Ben Mitch (view profile)


06 Jun 2002 (Updated )

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

| Watch this File

File Information

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


This file inspired Hyperplot Tools and Convert Between Rgb And Color Names.

MATLAB release MATLAB 6.0 (R12)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
09 Dec 2014 Mark Knecht

Works nicely. Thanks!

05 Nov 2014 Paul Quelet

Excellent function! Works wonderfully!

19 Aug 2014 Chad Greene

Chad Greene (view profile)

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

Comment only
06 Jun 2013 Alexandre Laurin

07 Dec 2012 Ofir Perry Bibi

30 Mar 2012 Paul

Paul (view profile)

22 Jun 2010 Matthew

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.

17 Oct 2008 lemes maykon

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

Comment only
19 Sep 2007 Alvaro Semedo

01 Nov 2006 GAbriella Musacchia

This was very helpful!

17 Aug 2005 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.

Contact us