Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Playing around with CIE Lab colors in R
#
# Playing around with CIE Lab colors in R
#
# load library that provides colorRampPalette
library(grDevices)
# define function for plotting colors
plotColors = function(palette, n=10) {
colors = palette(n)
barplot(rep(1,n), col=colors, border=colors, space=0, yaxt='n')
}
# take a look at rgb interpolation
pal = colorRampPalette(c("#FF0000", "#0000FF"))
plotColors(pal, 5)
# and compare it with Lab
pal = colorRampPalette(c("#FF0000", "#0000FF"), space="Lab")
plotColors(pal, 5)
@isomorphisms

This comment has been minimized.

Copy link

commented Jun 25, 2013

Thanks!

@bjtree

This comment has been minimized.

Copy link

commented Oct 31, 2016

This was great thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.