3

I would like to extract the background color of the notebook being used.

Why do you want to do that ?

The reason why I want to do this is because I would like for the color of the output to always have a good contrast with that of the notebook background. I would like to do this in a way that is independent of the user's choice for the background. In particular, Print, Plot and VertexLabels tend to print the output in black which is difficult to read when using a dark theme stylesheet.

Edit

The 4th post of the link that was accepted as a similar question gives the same answer as the comment by @andre314 below but used in a slightly different context.

userrandrand
  • 5,847
  • 6
  • 33
  • 1
    CurrentValue[EvaluationNotebook[], Background] or maybe SelectedNotebook[] instead of EvaluationNotebook[] ? – andre314 Jun 05 '22 at 14:52
  • Thank you very much! – userrandrand Jun 05 '22 at 20:16
  • @MarcoB yes but as the answer is a comment I do not know how to accept it. – userrandrand Jun 07 '22 at 22:04
  • @userrandrand On this page you should see a banner like the one described in this meta question showing the proposed duplicate and a button ("That solved my problem!") to confirm the duplicate link. That's only available to you as the question "owner". – MarcoB Jun 07 '22 at 22:22
  • @MarcoB Sorry, I got confused. I mistook the link you gave as my own question (i read it superficially) and understood "does this answer your question" as a question about whether andre314's comment answered my question. That is why I replied: "yes but as the answer is a comment...". – userrandrand Jun 08 '22 at 16:44
  • @MarcoB I added an edit to my post that mentions which one of the posts on the link you gave answers my question. Thank you. – userrandrand Jun 08 '22 at 16:54

0 Answers0