From a0ea69f235c0d51d5afaec29476a39662be9d248 Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Mon, 2 Dec 2024 06:18:37 -0800 Subject: [PATCH] fix #85 by_color is same as what_color --- R/bubble.R | 1 - R/say.R | 6 ++++-- man/say.Rd | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/R/bubble.R b/R/bubble.R index 7daf9ff..1fea268 100644 --- a/R/bubble.R +++ b/R/bubble.R @@ -42,7 +42,6 @@ bubble <- function(x, width = 60) { #' @param max_char_length (numeric) length of the maximum line. this is used #' to determine how much whitespace padding to add to the left of #' `thought_sym` -#' @inheritParams bubble #' @examplesIf interactive() #' bubble_tail(animals[["chicken"]]) #' cat(bubble_tail(animals[["chicken"]]), sep = "\n") diff --git a/R/say.R b/R/say.R index 598bb91..972154f 100644 --- a/R/say.R +++ b/R/say.R @@ -30,7 +30,9 @@ #' text color(s) or #' \href{https://github.com/r-lib/crayon#styles}{\code{crayon style function}} #' to color `who`. Use "rainbow" for -#' `c("red", "orange", "yellow", "green", "blue", "purple")` +#' `c("red", "orange", "yellow", "green", "blue", "purple")`. By default is +#' set to be whatever color `what_color` is so you can have the same color +#' for both with less typing. #' @param length (integer) Length of longcat. Ignored if other animals used. #' @param fortune An integer (or number that can be coerced #' to integer) specifying a fortune from the `fortunes` package - OR a @@ -129,7 +131,7 @@ #' say("catfact", "cat") say <- function( what = "Hello world!", by = "cow", type = NULL, - what_color = NULL, by_color = NULL, length = 18, fortune = NULL, + what_color = NULL, by_color = what_color, length = 18, fortune = NULL, thought_sym = "o", width = 60, ...) { stopifnot("what must be length 1" = has_length(what, 1)) diff --git a/man/say.Rd b/man/say.Rd index 82faa01..101fb39 100644 --- a/man/say.Rd +++ b/man/say.Rd @@ -9,7 +9,7 @@ say( by = "cow", type = NULL, what_color = NULL, - by_color = NULL, + by_color = what_color, length = 18, fortune = NULL, thought_sym = "o", @@ -50,7 +50,9 @@ Use "rainbow" for c("red", "orange", "yellow", "green", "blue", "purple").} text color(s) or \href{https://github.com/r-lib/crayon#styles}{\code{crayon style function}} to color \code{who}. Use "rainbow" for -\code{c("red", "orange", "yellow", "green", "blue", "purple")}} +\code{c("red", "orange", "yellow", "green", "blue", "purple")}. By default is +set to be whatever color \code{what_color} is so you can have the same color +for both with less typing.} \item{length}{(integer) Length of longcat. Ignored if other animals used.}