And this, this function that's returned by colorRamp will take values

between 1 and 1 indicating the extremes of the color palette.

And so, a similar function that already exists in R is the gray function.

And the gray function interpolates between black and white.

And so it gives you kind of all

the shades of gray there between black and white.

The colorRamp function is a generalization because it will take any

set of colors in your palette and it will give you

a function back that takes numbers between 0 and 1 and

it kind of interpolate between the extremes of the color palette.

The colorRampPalette is a very similar type of function it takes a palette

of colors and what it does it returns another function that rather than taking

a value between 0 and 1.

It would takes an integer argument and it

will return a vector of colors interpolating that palette.

So, this is similar to the heat.colors function or the topo.colors function.

So, So let's just.

A very quick example here.

In the top here, I've created I'm going to use

a palette that consists of two colors, red and blue.

So you can imagine that on your

little painter's palette here, you've got a blotch

of red and a blotch of blue, and you're going to

mix them together in varying degrees to create new colors.

So I, when I pass this through colorRamp it returns function back and

that function I've called pal, and, and now pal can take numbers between 0 and 1.

So when I say pal (0).

What do I get back?

I get a little matrix here with one row and three columns.

And the three columns

indicate, are, are, represent the colors red, blue and green.