Convert/coerce to CAM16-UCS matrix

pth_to_cam16ucs(
  color,
  c = 0.69,
  Y_b = 20,
  L_A = 64/pi/5,
  whitepoint = whitepoints_cie1931("D65")
)

pth_new_cam16ucs(
  mat,
  c = 0.69,
  Y_b = 20,
  L_A = 64/pi/5,
  whitepoint = whitepoints_cie1931("D65")
)

Arguments

color

character or matrix with S3 class pth_mat, a representation of a color.

c

numeric surround parameter, between 0.535 (dark) and 0.69 (average).

Y_b

numeric background luminance.

L_A

numeric luminance of the adapting field (cd/m^2).

whitepoint

double array with one dimension, length three; describes the whitepoint reference for the color space.

mat

double matrix with three columns, one row for each color.

Value

double

matrix with S3 classes pth_cam16ucs and pth_mat, with three columns, one row for each color.

Examples

  pth_to_cam16ucs("#663399")
#>            J'       a'        b'
#> [1,] 36.51274 18.38043 -21.89131
#> attr(,"class")
#> [1] "pth_cam16ucs" "pth_mat"     
#> attr(,"c")
#> [1] 0.69
#> attr(,"Y_b")
#> [1] 20
#> attr(,"L_A")
#> [1] 4.074367
#> attr(,"whitepoint")
#> [1]  95.047 100.000 108.883
  pth_new_cam16ucs(matrix(c(36.5, 18.4, -21.9), ncol = 3))
#>        J'   a'    b'
#> [1,] 36.5 18.4 -21.9
#> attr(,"class")
#> [1] "pth_cam16ucs" "pth_mat"     
#> attr(,"c")
#> [1] 0.69
#> attr(,"Y_b")
#> [1] 20
#> attr(,"L_A")
#> [1] 4.074367
#> attr(,"whitepoint")
#> [1]  95.047 100.000 108.883