Skip to content
Prev 349949 / 398513 Next

Convert color hex code to color names

Hi Alejo,
The color.id function in plotrix will do this, one color at a time:

sapply(rainbow(6),color.id)
     #FF0000FF #FFFF00FF #00FF00FF #00FFFFFF #0000FFFF #FF00FFFF
[1,] "red"     "yellow"  "green"   "cyan"    "blue"    "magenta"
[2,] "red1"    "yellow1" "green1"  "cyan1"   "blue1"   "magenta1"

Jim
On Tue, Apr 14, 2015 at 3:42 AM, David L Carlson <dcarlson at tamu.edu> wrote: