Created
April 20, 2015 19:15
-
-
Save EarlGlynn/cd83013ef2e4c0bcc331 to your computer and use it in GitHub Desktop.
256 Shades of Gray/Grey in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grays <- rep("", 256) | |
for (i in 1:256) | |
{ | |
hex2 <- sprintf("%02x", i-1); | |
grays[i] <- paste0("#", hex2, hex2, hex2) | |
} | |
barplot(rep(1,256), col=grays, yaxt="n", border=NA, space=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment