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:
Output:
[1] "white" "aliceblue" "antiquewhite"
[4] "antiquewhite1" "antiquewhite2" "antiquewhite3"
[7] "antiquewhite4" "aquamarine" "aquamarine1"
...
...
[655] "yellow3" "yellow4" "yellowgreen"
Example 2:
Python3
colors()[ 1 ]
colors()[ 3 ]
colors()[ 10 ]
colors()[ 655 ]
colors()[ 656 ]
|
Output:
[1] "white"
[1] "antiquewhite"
[1] "aquamarine2"
[1] "yellow3"
[1] "yellow4"
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
17 Jun, 2021
Like Article
Save Article