tests/testthat/test-25-distance.R

context("Calculating colour distances")

test_that("colour distances can be calculated", {
    expect_equal(round(distance(c("red","green","blue"),"red")), c(0,87,53))
    expect_error(distance("red", c("red","green","blue")), "Reference should be a single shade")
})

Try the shades package in your browser

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

shades documentation built on Aug. 2, 2019, 5:05 p.m.