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

Changing the pen color of the chalkboard plugin of reveal.js in RStudio #62

Closed
grayknight2 opened this issue Feb 24, 2018 · 3 comments · Fixed by #88
Closed

Changing the pen color of the chalkboard plugin of reveal.js in RStudio #62

grayknight2 opened this issue Feb 24, 2018 · 3 comments · Fixed by #88
Labels
bug an unexpected problem or unintended behavior template pandoc's template

Comments

@grayknight2
Copy link

grayknight2 commented Feb 24, 2018

I´m trying to change the pen color for the chalkboard plugin of reveal.js in RStudio. I have the following code:

title: "Presentation"
author: "Me"
date: "2018"
output:
  revealjs::revealjs_presentation:
    theme: league
    transition: convex
    highlight: zenburn
    self_contained: false
    reveal_plugins: ["notes", "zoom", "chalkboard"]
    css: slides.css
    reveal_options:
      chalkboard:
        theme: whiteboard
        color: ['rgba(255, 0, 0, 0.3)'] # red
      previewLinks: true
      slideNumber: true
  beamer_presentation:
    toc: false
    incremental: false 

The color parameter should do the trick, but no matter what color I set I always get a black pen color if I set that parameter (default color is blue). How could I set It to any color I want?

Following the plugin documentation It says I should use:
color: ['rgba(255, 0, 0, 0.3)', 'rgba(255, 0, 0, 0.3)'] # red, red

This works with "actual" reveal.js, but this gives an error in RStudio, that's why I'm setting only one color. Is there a bug within the RStudio implementation?

@okrebs
Copy link

okrebs commented Feb 29, 2020

I have the same issue. I recognized that setting the option "color: ['rgba(255, 0, 0, 0.3)']" or any similar option that contains [ ] these brackets are removed in the produced html code.

Thus it will read " color: 'rgba(255, 0, 0, 0.3)'" in the given example. With a single 'wrong' string the pen color then defaults to black.

Setting multiple colors, e.g. "color: ['rgba(255, 0, 0, 0.3)', 'rgba(0, 255, 0, 0.3)']" is, in the produced html code, turned into "color: 'rgba(255, 0, 0, 0.3)', 'rgba(0, 255, 0, 0.3)'" which results in an error an unuseable html code (due to another option being expected after the ',')

Escaping the brackets like so "/[" does not work since they are then kept together with the escape character in the final html code. Does anyone know which part of the code removes the brackets [ ] from the values passed to options?

@atusy
Copy link
Contributor

atusy commented Jun 10, 2021

I opened a PR to fix this issue. You can try it by installing the patched version with

remotes::install_github("rstudio/revealjs#62")

@cderv cderv added bug an unexpected problem or unintended behavior template pandoc's template labels Sep 16, 2021
@cderv cderv closed this as completed in #88 Sep 16, 2021
cderv added a commit that referenced this issue Sep 16, 2021
fixes #62

Co-authored-by: christophe dervieux <christophe.dervieux@gmail.com>
@cderv
Copy link
Collaborator

cderv commented Sep 16, 2021

For the record, PR number is #88 so it was

remotes::install_github("rstudio/revealjs#88")

but this is now merged so this is enough

remotes::install_github("rstudio/revealjs")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior template pandoc's template
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants