Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplifying color argument #85

Open
ecrs98 opened this issue Oct 1, 2023 · 4 comments
Open

Simplifying color argument #85

ecrs98 opened this issue Oct 1, 2023 · 4 comments
Milestone

Comments

@ecrs98
Copy link

ecrs98 commented Oct 1, 2023

Hey Scott,

Just wondering, would it be possible to add functionality to say() that would allow for a single color argument? Having separate arguments for what_color and by_color is necessary. Most of the time, though, I specify these to be the same color. It would be nice to specify color = "blue", for example, and have that be equivalent to what_color = "blue", by_color = "blue".

Love the package by the way. Makes my coding work flow a little more fun :-)


thanks!

\   ^__^ 
 \  (oo)\ ________ 
    (__)\         )\ /\ 
         ||------w|
         ||      ||

--Ethan

@sckott
Copy link
Owner

sckott commented Oct 7, 2023

Thanks for your issue @ecrs98 ! I'm so glad it makes coding more fun.

What do you think @aedobbyn ? Does this seem like a good idea, and if so, can it be done easily?

@sckott
Copy link
Owner

sckott commented Oct 10, 2023

@ecrs98 let's wait a bit to see if amanda responds. if not soon, we can move ahead discussing this

@aedobbyn
Copy link
Contributor

hi, so glad you like the package! so my first instinct here is that it would be possible to do of course, but that this argument would be redundant given that it's covered by the other two already there so i don't love it design-wise. what do you think @sckott?

@sckott sckott added this to the v0.9 milestone Oct 13, 2023
@sckott
Copy link
Owner

sckott commented Oct 14, 2023

Thanks @aedobbyn ! One idea is we could do in the function definition

say <- function(what="Hello world!", by="cat",
                type=NULL,
                what_color=NULL, by_color=what_color, <--------- 
                length=18, fortune=NULL, ...) 

Where we set by_color to be whatever is set in what_color UNLESS by_color is set to something by the user. NULL is still the default for by_color here.

I agree I don't think we should add a new parameter.

@sckott sckott modified the milestones: v0.9, v1.0 Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants