search for: rgb2hsv

Displaying 20 results from an estimated 23 matches for "rgb2hsv".

2016 Apr 16
1
Mean of hexadecimal numbers
Hm..., Should these two versions produce the same solution? Unfortunately and shame to confess, I don't know much about the colors in R: myColors <- c("#FF7C00","#00BF40","#FFFF00") Colors=rgb2hsv(col2rgb(myColors)) apply(Colors,1,mean) h s v 0.2122974 1.0000000 0.9163399 * * * * * # Average the 1st two by taking the middle colour of a 3 colour palette x <- colorRampPalette(c("#FF7C00","#00BF40"), space = "Lab")(3)[2] # Average in...
2008 Mar 31
2
hsv2rgb in R
I noted that there is a hsv2rgb in the C-API, but no corresponding function in R, while rgb2hsv is available in R. Does the functionality of hsv2rgb hide under some other name? Dieter
2016 Apr 16
0
Mean of hexadecimal numbers
On 16/04/2016 8:47 AM, Atte Tenkanen wrote: > Hi, > > How would you calculate the "mean colour" of several colours, for > example c("#FF7C00","#00BF40","#FFFF00")? > Bert answered your subject line question. Your text is asking something else: if those are colours, you don't want to treat each of them as a single integer. A
2016 Apr 16
0
Mean of hexadecimal numbers
...gt; > Should these two versions produce the same solution? I wouldn't expect them to. Duncan Murdoch Unfortunately and > shame to confess, I don't know much about the colors in R: > > myColors <- c("#FF7C00","#00BF40","#FFFF00") > Colors=rgb2hsv(col2rgb(myColors)) > apply(Colors,1,mean) > > h s v > 0.2122974 1.0000000 0.9163399 > > * * * * * > > # Average the 1st two by taking the middle colour of a 3 colour palette > x <- colorRampPalette(c("#FF7C00","#00BF40"), s...
2003 Dec 09
1
arni.colors
...existing palette() function. Of course I don't mind if the R Core Team changes the function name or any other part of the code. Thanks, Arni arni.colors <- function(n, palette=c("temperature", "depth"), rgb.matrix=FALSE, plot.colors=FALSE) { rgb2hsv <- function(v) rgb(v[1], v[2], v[3]) palette <- match.arg(palette) x <- seq(0, 1, length=n) if(palette == "temperature") { r <- 1 / (1+exp(20-35*x)) g <- pmin(pmax(0,-0.8+6*x-5*x^2), 1) b <- dnorm(x,0.25,0.15) / max(dnorm(x,0.25,0.15)) } else {...
2016 Apr 16
0
Mean of hexadecimal numbers
...nd perhaps use the mean in one of those spaces as your 'average color'. > myColors <- c(One="#FF7C00",Two="#00BF40",Three="#FFFF00") > col2rgb(myColors) One Two Three red 255 0 255 green 124 191 255 blue 0 64 0 > rgb2hsv(col2rgb(myColors)) One Two Three h 0.08104575 0.3891798 0.1666667 s 1.00000000 1.0000000 1.0000000 v 1.00000000 0.7490196 1.0000000 Bill Dunlap TIBCO Software wdunlap tibco.com On Sat, Apr 16, 2016 at 8:27 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: >...
2005 Jul 07
2
Brewer colours
...]), seqout)$y + .5) r[r < 0] <- 0 ; r[r > 255] <- 255 g[g < 0] <- 0 ; g[g > 255] <- 255 b[b < 0] <- 0 ; b[b > 255] <- 255 for (i in 1:n) { cat(r[i], g[i], b[i], "\n") } } showpalette <- function (palette) { n <- length(palette) rgb2hsv <- function(v) rgb(v[1], v[2], v[3]) x <- seq(0, 1, length=n) rgb.m <- matrix(col2rgb(palette) / 255, ncol=3,, byrow=TRUE, dimnames=list(as.character(seq(length=n)), c("red","green","blue"))) hsv.v <- apply(rgb.m,...
2016 Apr 16
2
Mean of hexadecimal numbers
... and if you need to convert back: ?as.hexmode -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Apr 16, 2016 at 8:20 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > ?strtoi > > You'll have to remove
2016 Apr 16
5
Mean of hexadecimal numbers
Hi, How would you calculate the "mean colour" of several colours, for example c("#FF7C00","#00BF40","#FFFF00")? Yours, Atte Tenkanen
2011 Jul 20
0
Is it possible to save raster data as a bitmap?
...rking on: # Start example require("RImageJ") # first open image and store as raster logo <- system.file("images", "R.jpg", package = "RImageJ") img <- as.raster(IJ$openImage(logo)) # do some modifications modify <- as.raster(matrix(hsv(1, 1, 0.5 * rgb2hsv(col2rgb(img))[3,]), nrow(img), ncol(img))) # End example The next step in the example would be to store the raster data 'modify' as a bitmap image. I know that the 'image' function of the 'graphics' library might be usable for this purpose. However, I'm at a loss on ho...
2004 Oct 17
1
FW: Plotcorr: colour the ellipses to emphasize the differences
-----Original Message----- From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca] Sent: ned 2004-10-17 15:34 To: Gorjanc Gregor Cc: r-help at stat.math.ethz.ch Subject: Re: [R] Plotcorr: colour the ellipses to emphasize the differences On Sun, 17 Oct 2004 02:51:58 +0200, "Gorjanc Gregor" <Gregor.Gorjanc at bfro.uni-lj.si> wrote: [removed old stuff] >>I would also like to
2006 Aug 01
2
rgb and col2rgb color conversion/modification/shading
I want to get a lighter shade of a color...I have a lot of colored objects and want each one printed as a foreground against a slightly lighter background. I thought I could try something like changing the alpha channel by first converting it to rgb. But prior to trying that, I'm stuck with how to get the color after converting using col2rgb() to be interpreted again as a color, rather than
2010 Jan 28
2
color palette for points, lines, text / interactive Rcolorpicker?
I'm looking for a scheme to generate a default color palette for plotting points, lines and text (on a white or transparent background) with from 2 to say 9 colors with the following constraints: - "red" is reserved for another purpose - colors should be highly distinct - avoid light colors (like "yellow"s) In RColorBrewer, most of the schemes are designed for area fill
2000 Mar 29
1
pre summary: mapping of colornames into hsv?
...b.c wouldn't be needed anymore ? > -- or just declare the tables in Graphics.h and use them in > graphapp as well? > }} > > > Potential useful functions {from graphics.c} to be made > available on the R > level are > > hsv2rgb() (h,s,v) |-> (r,g,b) > > rgb2hsv() does *NOT* exist in graphics.c ; > is it possible at all (i.e. is hsv <--> rgb 1:1 ?)} > > rgb2col(rgb_ch) |-> uint { := unsigned int } > name2col (ch) |-> uint > number2col(ch) |-> uint > str2col (ch) |-> uint {calling one of the above 3 functions !}...
2004 Apr 12
1
R 1.9.0 is release
...ity. If both `times' and `length.out' have been specified, `times' is now ignored for S compatibility. (Previously padding with NAs was used.) The "POSIXct" and "POSIXlt" methods for rep() now pass ... on to the default method (as expected by PR#5818). o rgb2hsv() is new, an R interface the C API function with the same name. o User hooks can be set for onLoad, library, detach and onUnload of packages/namespaces: see ?setHook. o save() default arguments can now be set using option "save.defaults", which is also used by save.image() if...
2004 Apr 12
1
R 1.9.0 is release
...ity. If both `times' and `length.out' have been specified, `times' is now ignored for S compatibility. (Previously padding with NAs was used.) The "POSIXct" and "POSIXlt" methods for rep() now pass ... on to the default method (as expected by PR#5818). o rgb2hsv() is new, an R interface the C API function with the same name. o User hooks can be set for onLoad, library, detach and onUnload of packages/namespaces: see ?setHook. o save() default arguments can now be set using option "save.defaults", which is also used by save.image() if...
2008 Mar 29
1
A patch for extending pdf device to embed popup text and web links
...te, pdf, + pdf.annot.box, pdf.text.box.info, pdf.link.on.box, pdf.text.on.box, + pdf.link.on.text, pdf.text.on.text, pdf.options, pdfFonts, pictex, postscript, postscriptFont, postscriptFonts, ps.options, rainbow, recordGraphics, recordPlot, replayPlot, rgb, rgb2hsv, savePlot, setEPS, setPS, diff -r -c R.org/src/library/grDevices/R/postscript.R R/src/library/grDevices/R/postscript.R *** R.org/src/library/grDevices/R/postscript.R 2008-03-29 23:36:12.000000000 +0900 --- R/src/library/grDevices/R/postscript.R 2008-03-30 01:41:13.000000000 +0900 *************** **...
2011 Apr 13
0
R 2.13.0 is released
...e of browseVignetttes()). DEPRECATED & DEFUNCT: ? require(save = TRUE) is defunct, and use of the save argument is deprecated. ? R CMD check --no-latex is defunct: use --no-manual instead. ? R CMD Sd2Rd is defunct. ? The gamma argument to hsv(), rainbow(), and rgb2hsv() is deprecated and no longer has any effect. ? The previous options for R CMD build --binary (--auto-zip, --use-zip-data and --no-docs) are deprecated (or defunct): use the new option --install-args instead. ? When a character value is used for the EXPR argument in swit...
2011 Apr 13
0
R 2.13.0 is released
...e of browseVignetttes()). DEPRECATED & DEFUNCT: ? require(save = TRUE) is defunct, and use of the save argument is deprecated. ? R CMD check --no-latex is defunct: use --no-manual instead. ? R CMD Sd2Rd is defunct. ? The gamma argument to hsv(), rainbow(), and rgb2hsv() is deprecated and no longer has any effect. ? The previous options for R CMD build --binary (--auto-zip, --use-zip-data and --no-docs) are deprecated (or defunct): use the new option --install-args instead. ? When a character value is used for the EXPR argument in swit...
2011 Oct 31
0
R 2.14.0 is released
...D build on a Unix-alike (only) now tries to preserve dates on files it copies from its input directory. (This was the undocumented behaviour prior to R 2.13.0.) DEPRECATED AND DEFUNCT: o require() no longer has a save argument. o The gamma argument to hsv(), rainbow(), and rgb2hsv() has been removed. o The --no-docs option for R CMD build --binary is defunct: use --install-args instead. o The option --unsafe to R CMD INSTALL is defunct: use the identical option --no-lock instead. o The entry point pythag formerly in Rmath.h is defunct: use...