tests/testthat/test-toRGB.R

test_that("toRGB(NULL) is NULL", {
  expect_identical(toRGB(NULL), NULL)
})

test_that("Can apply alpha recursively with toRGB()", {
  col <- toRGB(toRGB("black", 0.9), 0.9)
  expect_match(col, "rgba\\(0,0,0,0\\.80")
})

Try the plotly package in your browser

Any scripts or data that you put into this service are public.

plotly documentation built on May 29, 2024, 2:23 a.m.