tests/testthat/test-lighten.r

test_that("fade and alpha", {
  
  grDevices::pdf(file = tf <- tempfile(fileext = ".pdf"))
  on.exit({ grDevices::dev.off(); unlink(tf) }, add = TRUE)
  
  expect_equal(fillpattern:::lighten("black", "black", 1, 1), "black")
  expect_equal(fillpattern:::lighten(NA,      "black", 1, 0), "#00000000")
  expect_equal(fillpattern:::lighten("black", "black", 0, 0), "#FFFFFF00")
})

Try the fillpattern package in your browser

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

fillpattern documentation built on June 25, 2024, 1:10 a.m.