Change Color 0-1 to 0-255

In my RSTUDIO I can only use colors between 0 and 1 e,g, col = rgb(1, 0, 1)

but in the solution to my homework they use colors betwwen 0 and 255 e,g, col = rgb(255, 0, 255)

How can I change the scale?

Add max = 255.

> rgb(255, 0, 255, max = 255)
[1] "#FF00FF"
> rgb(1, 0, 1)
[1] "#FF00FF"

Use the help function (e.g. ?rgb())? for more info.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.