What is the HEX code for "transparent" color? I've tried "00000000" "FFFFFF00" "FFFFFFFF", but they don't work. Thanks [[alternative HTML version deleted]]
You need a "#" at the beginning of the string to specify that it is a hex code for the color. Try "#00000000". On Thu, Jun 6, 2024 at 9:07?AM Yosu Yurramendi <yosu.yurramendi at gmail.com> wrote:> > What is the HEX code for "transparent" color? > I've tried "00000000" "FFFFFF00" "FFFFFFFF", but they don't work. > Thanks > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
You would give an existing color a new name and modify the new name's alpha. Then refer to the color by the new name instead of using HEX. On Thu, Jun 6, 2024, 11:07?AM Yosu Yurramendi <yosu.yurramendi at gmail.com> wrote:> What is the HEX code for "transparent" color? > I've tried "00000000" "FFFFFF00" "FFFFFFFF", but they don't work. > Thanks > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
On 2024-06-06 4:37 a.m., Yosu Yurramendi wrote:> What is the HEX code for "transparent" color? > I've tried "00000000" "FFFFFF00" "FFFFFFFF", but they don't work.If the other answers don't solve your problem, you should give us some context. Not all graphics functions in R can handle transparency, so please show us some reproducible code for what you are trying. Duncan Murdoch
Thank you all very much for the answers given (Greg, Robert, Duncan, Roland). Actually, I had tried with "#00000000" and "#FFFFFF00" (I had a mistake in the message). For example it works with: numrows <- 3; numcols <- 3 a <- c(1,0,1,1,1,1,1,0,1) (pattern <- matrix(a, numrows, numcols, byrow=TRUE)) # png(filename="transparency.00.png") par(bg="#00000000") palette <- c("#00000000", "black") image(t(pattern), col = palette, axes = FALSE) dev.off() I took into account Duncan's answer: 'If the other answers don't solve your problem, you should give us some context. Not all graphics functions in R can handle transparency, so please show us some reproducible code for what you are trying.' But it doesn't work on Shiny. library(shiny) # Define UI for application that draws a histogram ui <- fluidPage( titlePanel(h3("Binary pattern (r,c)-rectangular grid", align "center")), sidebarLayout( sidebarPanel( numericInput("r", "Number of rows:", 3), numericInput("c", "Number of columns:", 3) ), mainPanel(plotOutput("distPlot")) ) ) server <- function(input, output) { output$distPlot <- renderPlot({ numrows <- 3; numcols <- 3 a <- c(1,0,1,1,1,1,1,0,1) pattern <- matrix(a, numrows, numcols, byrow=TRUE) palette <- c("#00000000", "black") par(bg="#00000000") # image(t(pattern), col = palette, axes = FALSE) }) } shinyApp(ui = ui, server = server) Any explanation? Any help? Thanks Hau idatzi du Yosu Yurramendi (yosu.yurramendi at gmail.com) erabiltzaileak (2024 eka. 6(a), og. (10:37)):> What is the HEX code for "transparent" color? > I've tried "00000000" "FFFFFF00" "FFFFFFFF", but they don't work. > Thanks >[[alternative HTML version deleted]]
Gabor Grothendieck
2024-Jun-17 18:14 UTC
[R] What is the HEX code for "transparent" color?
adjustcolor("#123456", alpha = 0.5) will return the indicated color with an alpha transparency of 50% . On Thu, Jun 6, 2024 at 11:07?AM Yosu Yurramendi <yosu.yurramendi at gmail.com> wrote:> > What is the HEX code for "transparent" color? > I've tried "00000000" "FFFFFF00" "FFFFFFFF", but they don't work. > Thanks > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com