R Under development (unstable) (2023-09-30 r85239 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > library(lattice) > > pdf("shade-wireframe.pdf") > > classicShadePalette <- function(irr, ref, height, saturation = .9) + { + hsv(h = height, s = 1 - saturation * (1 - (1-ref)^0.5), v = irr) + } > trellis.par.set(shade.colors = list(palette = classicShadePalette)) > wireframe(volcano, shade = TRUE) > > ## Using makeShadePalette() > > ## matte > cm.palette <- makeShadePalette(cm.colors(10), pref = 0.2) > trellis.par.set(shade.colors = list(palette = cm.palette)) > wireframe(volcano, shade = TRUE) > > ## glossy > cm.palette <- makeShadePalette(cm.colors(10), pref = 1.2) > trellis.par.set(shade.colors = list(palette = cm.palette)) > wireframe(volcano, shade = TRUE) > > ygb.palette <- makeShadePalette(rev(hcl.colors(12, "YlGnBu"))) > trellis.par.set(shade.colors = list(palette = ygb.palette)) > wireframe(volcano, shade = TRUE) > > dev.off() null device 1 > > proc.time() user system elapsed 2.70 0.09 2.78