[R] Convert RGB-sRBG

2009-06-23 Thread Paulo E. Cardoso
Hi, How can I convert from 8-bit RGB color to [0-1] interval (sRGB) and vice-versa? Thanks in advance Paulo E. Cardoso [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Convert RGB-sRBG

2009-06-23 Thread Dieter Menne
Paulo Cardoso wrote: How can I convert from 8-bit RGB color to [0-1] interval (sRGB) and vice-versa? If you have the R/G/B values separately, divide by 255, and use function rgb in grDevices. If you have the hex values, paste these into a string, and use something like col2rgb(#2C312C)

Re: [R] Convert RGB-sRBG

2009-06-23 Thread Barry Rowlingson
On Tue, Jun 23, 2009 at 2:26 PM, Dieter Menne dieter.me...@menne-biomed.dewrote: Paulo Cardoso wrote: How can I convert from 8-bit RGB color to [0-1] interval (sRGB) and vice-versa? If you have the R/G/B values separately, divide by 255, and use function rgb in grDevices. If you

Re: [R] Convert RGB-sRBG

2009-06-23 Thread Dieter Menne
Barry Rowlingson wrote: 8-bit color graphics often refers to a situation where each pixel is 8 bits, and the colour comes from a 256-colour palette lookup table. If you really have a 8 bit palettized colour lookup, as Barry assumes, you better use one of the build-in conversions, for