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

Block background color #193

Closed
rodrigoalcarazdelaosa opened this issue Mar 8, 2016 · 8 comments
Closed

Block background color #193

rodrigoalcarazdelaosa opened this issue Mar 8, 2016 · 8 comments

Comments

@rodrigoalcarazdelaosa
Copy link

Hi,

if I am not mistaken, currently all three block types share the same background color, which is based on the normal text color (both fg and bg).

Have you considered setting the background color depending on the block type (depending on the alerted and example fg colors, respectively)?

Thanks,

@benjamin-weiss
Copy link
Contributor

if I am not mistaken, currently all three block types share the same background color

You are not mistaken, that's right.

Have you considered setting the background color depending on the block type

Do you mean something like this?

demo verschoben

Probably not, because that doesn't look good at all (imho). Could you make an example what you mean? You just have to set the colors manually after loading the theme with

\setbeamercolor{block title alerted}{ ... }
\setbeamercolor{block body alerted}{ ... }

for the alerted block and can then post a picture here.

But either way, I think it is a good decision to use the same background color for all blocks. In my opinion too much color is too distracting.

@rchurchley
Copy link
Contributor

Have you considered setting the background color depending on the block type?

Do you mean something like this?

I expect @alcarazr is proposing something along the lines of the Beamer colour themes crane, orchid, and rose:

screen shot 2016-03-08 at 5 59 40 pm

I think this and the current design look equally good and do not have strong opinions on the matter. Having more colour can be distracting sometimes (I tend to feel this way about example blocks) but it can also help focus the audience's attention to an important part of the slide (most common with alert blocks).

I would not object to either changing it or keeping the same. But either way, it's a design choice worth considering. (Thanks for the suggestion, @alcarazr!)

@matze, @benjamin-weiss, what do you think?

@rodrigoalcarazdelaosa
Copy link
Author

A full color conversion would actually look more like this (code below image):

blocks

\documentclass{beamer}

\usetheme{metropolis}

% Colors based on Paul Tol's recommendations for marking text (https://personal.sron.nl/~pault/#textmarking)

\definecolor{BlueTOL}{HTML}{222255}
\definecolor{BrownTOL}{HTML}{666633}
\definecolor{GreenTOL}{HTML}{225522}
\setbeamercolor{normal text}{fg=BlueTOL,bg=white}
\setbeamercolor{alerted text}{fg=BrownTOL}
\setbeamercolor{example text}{fg=GreenTOL}

\setbeamercolor{block title alerted}{use=alerted text,
    fg=alerted text.fg,
    bg=}
\setbeamercolor{block body alerted}{use={block title alerted, alerted text},
    fg=alerted text.fg,
    bg=}
\setbeamercolor{block title example}{use=example text,
    fg=example text.fg,
    bg=}
\setbeamercolor{block body example}{use={block title example, example text},
    fg=example text.fg,
    bg=}

\begin{document}

\begin{frame}{Blocks}
  Three different block environments are pre-defined and may be styled with an
  optional background color.

  \begin{columns}[T,onlytextwidth]
    \column{0.5\textwidth}
      \begin{block}{Default}
        Block content.
      \end{block}

      \begin{alertblock}{Alert}
        Block content.
      \end{alertblock}

      \begin{exampleblock}{Example}
        Block content.
      \end{exampleblock}

    \column{0.5\textwidth}

      \metroset{block=fill}

\setbeamercolor{block title alerted}{use=alerted text,
    fg=alerted text.fg,
    bg=alerted text.bg!80!alerted text.fg}
\setbeamercolor{block body alerted}{use={block title alerted, alerted text},
    fg=alerted text.fg,
    bg=block title alerted.bg!50!alerted text.bg}
\setbeamercolor{block title example}{use=example text,
    fg=example text.fg,
    bg=example text.bg!80!example text.fg}
\setbeamercolor{block body example}{use={block title example, example text},
    fg=example text.fg,
    bg=block title example.bg!50!example text.bg}

      \begin{block}{Default}
        Block content.
      \end{block}

      \begin{alertblock}{Alert}
        Block content.
      \end{alertblock}

      \begin{exampleblock}{Example}
        Block content.
      \end{exampleblock}

  \end{columns}
\end{frame}

\end{document}

In this example I have used Paul Tol's recommendations for marking text. I agree too much color may be distracting, but at the same time if you do not want it, just use normal blocks all the time.

@matze
Copy link
Owner

matze commented Mar 9, 2016

Tough decision, I actually prefer Ross' suggestion because it provides good contrast but does not clash as hard as Benjamin's implementation. The full color conversion inhibits readability in my opinion. By the way, as far as I can see Paul Tol's notes address coloring data for visualization purposes, so in the context of typesetting text and beamer slides in particular we should take his advice with a grain of salt.

@benjamin-weiss
Copy link
Contributor

The full color conversion inhibits readability in my opinion.

I think so too.

I think this and the current design look equally good and do not have strong opinions on the matter.

As I wrote earlier, I would really like to keep the current implementation. So why not just add a third option. E. g. block=colorfill?

@rodrigoalcarazdelaosa
Copy link
Author

Given that the colors can be easily changed after loading the package, I would say the best option is leaving it to the user, keeping the current implementation. A third option as suggested by @benjamin-weiss implies making a design decisión as well.

@rchurchley
Copy link
Contributor

Sounds like the consensus is to keep the current design as-is!

I agree that it's probably best to expect the user to use \setbeamercolor themselves if they want to customize the block colours. As this discussion shows, each user will likely have slightly different preferences, and there are too many different possibilities to implement as package options. I think it's reasonable to stick with just block=transparent and block=fill.

If everyone is fine with that, I guess we can close this issue. Thanks again to @alcarazr for prompting the discussion!

@matze
Copy link
Owner

matze commented Mar 10, 2016

If everyone is fine with that, I guess we can close this issue.

Alright.

@matze matze closed this as completed Mar 10, 2016
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

4 participants