2

To produce good color schemes for styling notebook I was used to generate a grid of controls

grid = {
   {Dynamic[background], 
    ColorSlider[Dynamic[background], ImageSize -> {800, 100}, 
     AppearanceElements -> "Spectrum"]},
   {Dynamic[fontColor], 
    ColorSlider[Dynamic[fontColor], ImageSize -> {800, 100}, 
     AppearanceElements -> "Spectrum"]},
   {Dynamic[cellframecolor], 
    ColorSlider[Dynamic[cellframecolor], ImageSize -> {800, 100}, 
     AppearanceElements -> "Spectrum"]}
   };
Grid @ grid

and print a cell whose options are manipulated through the previous sliders:

CellPrint[Cell["this", "Text"
   , CellFrame -> True
   , CellFrameColor -> Dynamic[cellframecolor]
   , Background -> Dynamic[background]
   , FontColor -> Dynamic[fontColor]
   ]
  ];

How can the same be achieved for the whole notebook's stylesheet, not for the specific cell ? I have not been capable to get it using CurrentValue[EvaluationNotebook[], "StyleDefinitions"].

mitochondrial
  • 1,843
  • 10
  • 16
  • Whatever you want to do, put them in stylesheet or just SetOptions[EvaluationNotebook[],...] keep in mind that cellframecolor will not survive through sessions and next time you open the notebook it will be broken. – Kuba Feb 25 '16 at 20:37
  • In How to put Magnification control in docked cell I have explained how to continuously change notebook's Magnification, you can do the same with other options. – Kuba Feb 25 '16 at 20:38
  • Hi! That cellframecolor get lost between sessions isn't an issue for the use I make of it: I can save as you explained yesterday in http://mathematica.stackexchange.com/questions/108266/an-issue-regarding-the-use-of-copytoclipboard-with-dynamic-content. My block is about CurrentValue: I have been experimenting with no result: please, can you provide a simple example to set, let's say, the background color for Title cells style ? – mitochondrial Feb 25 '16 at 20:47
  • Options for a notebook are ok, provided that I can save their values, to put them in a stylesheet by hand. – mitochondrial Feb 25 '16 at 20:56
  • Is this useful? http://mathematica.stackexchange.com/questions/7738/defining-functions-in-stylesheets/7744#7744 – Mike Honeychurch Feb 25 '16 at 21:08
  • Yes ! This do the job: ColorSlider[Dynamic[fontColor], ImageSize -> {800, 100}, AppearanceElements -> "Spectrum"] SetOptions[EvaluationNotebook[], StyleDefinitions -> Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], Cell[StyleData["Text"], FontColor -> Dynamic[fontColor]]}, StyleDefinitions -> "PrivateStylesheetFormatting.nb"]] – mitochondrial Feb 25 '16 at 21:36

2 Answers2

2

Is this the sort of thing you are looking for?

enter image description here

If so possible duplicate.

Mike Honeychurch
  • 37,541
  • 3
  • 85
  • 158
0

Is this what you need ? :

grid = {
   {Dynamic[background], 
    ColorSlider[Dynamic[background], ImageSize -> {800, 100}, 
     AppearanceElements -> "Spectrum"]},
   {Dynamic[fontColor], 
    ColorSlider[Dynamic[fontColor], ImageSize -> {800, 100}, 
     AppearanceElements -> "Spectrum"]},
   {Dynamic[cellframecolor], 
    ColorSlider[Dynamic[cellframecolor], ImageSize -> {800, 100}, 
     AppearanceElements -> "Spectrum"]}
   };

Grid @ grid

SetOptions[EvaluationNotebook[], StyleDefinitions -> Notebook[{
    Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData["Text"], {
      CellFrame -> True,
      CellFrameColor -> Dynamic[cellframecolor],
      Background -> Dynamic[background],
      FontColor -> Dynamic[fontColor]}]}]]

 CellPrint[Cell["this", "Text"]]
 CellPrint[Cell["that", "Text"]]
andre314
  • 18,474
  • 1
  • 36
  • 69