tests/testthat/test-validateColor.R

test_that("testing validateColor()", {
  expect_equal("yellow", validateColor("yellow"))
  expect_error(validateColor("not-a-color"), "Color 'not-a-color' must be a valid color name or hexadecimal color.")
  expect_warning(validateColor("#00000000"), "Alpha channel is not supported and will be removed from '#00000000'.")
})

Try the NGCHM package in your browser

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

NGCHM documentation built on April 4, 2025, 3:48 a.m.