Skip to content

Commit

Permalink
made 'trekcolors' optional
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Jun 30, 2023
1 parent 761b484 commit 9072b24
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
8 changes: 6 additions & 2 deletions R/gyro.R
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,14 @@ gyrocentroid <- function(A, B, C, s = 1, model = "U"){
#' shade3d(ABC, color = "navy", specular = "cyan")}
#'
#' # using a color palette ####
#' library(trekcolors)
#' if(require("trekcolors")) {
#' pal <- trek_pal("klingon")
#' } else {
#' pal <- hcl.colors(32L, palette = "Rocket")
#' }
#' ABC <- gyrotriangle(
#' A, B, C, s = 0.5,
#' palette = trek_pal("klingon"), bias = 1.5, interpolate = "spline"
#' palette = pal, bias = 1.5, interpolate = "spline"
#' )
#' \donttest{open3d(windowRect = c(50, 50, 562, 562))
#' view3d(zoom = 0.75)
Expand Down
8 changes: 6 additions & 2 deletions R/hdelaunay.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ hdelaunay <- function(
#'
#' # example with colors given by a function ####
#' library(gyro)
#' library(trekcolors)
#' if(require("trekcolors")) {
#' pal <- trek_pal("klingon")
#' } else {
#' pal <- hcl.colors(32L, palette = "Rocket")
#' }
#'
#' phi <- (1 + sqrt(5)) / 2
#' theta <- head(seq(0, pi/2, length.out = 11), -1L)
Expand All @@ -167,7 +171,7 @@ hdelaunay <- function(
#' hdel <- hdelaunay(pts, model = "M")
#'
#' fcolor <- function(t){
#' RGB <- colorRamp(trek_pal("klingon"))(t)
#' RGB <- colorRamp(pal)(t)
#' rgb(RGB[, 1L], RGB[, 2L], RGB[, 3L], maxColorValue = 255)
#' }
#'
Expand Down
8 changes: 6 additions & 2 deletions man/gyrotriangle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/plotHdelaunay.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9072b24

Please sign in to comment.