Get a List of all the 657 colors in R Programming – colors() Function

colors() function in R Language is used to show all the 657 color names that are contained in R programming.

Syntax: colors()

Parameters:
Does not accept any parameters.

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to illustrate
# colors function
  
# Calling the colors() function
# to show all the 657 colors that
# names are contained in 
# R programming
colors()

chevron_right


Output:

[1] "white"                "aliceblue"            "antiquewhite"        
[4] "antiquewhite1"        "antiquewhite2"        "antiquewhite3"       
[7] "antiquewhite4"        "aquamarine"           "aquamarine1"
...
...
[655] "yellow3"              "yellow4"              "yellowgreen"

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to illustrate
# colors function
  
# Calling the colors() function
# with specific serial number of
# color names contained in R
# Prgramming
colors()[1]
colors()[3]
colors()[10]
colors()[655]
colors()[656]

chevron_right


Output:

[1] "white"
[1] "antiquewhite"
[1] "aquamarine2"
[1] "yellow3"
[1] "yellow4"
My Personal Notes arrow_drop_up

Recommended Posts:


Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : Akanksha_Rai

Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.