Wybieranie kolorów

Przycisk “Insert Color” wstawia wybraną funkcję koloru 
w miejsce kursora w poprzednio aktywnym notebooku.

TabView[{
Style[" NamedColors ",Black,22]->
Manipulate[
(*Wyrażenie którym manipulujemy*)
fcolor=color;
If[modify,
If[cor==1,fcolor=Lighter[fcolor,f],
If[cor==-1,fcolor=Darker[fcolor,f]],],
];
Column[{
Graphics[{fcolor,Disk[{0,0}]},ImageSize->300],
Button[" Insert Color ",
NotebookWrite[Notebooks[][[2]],fcolor],
BaseStyle->{Bold,22},
ImageMargins->5]},Center],
(* Kontrolki *)
{{color,Red,Style["Kolor",20]},
{Red->"Red",
Green->"Green",
Blue->"Blue",
Black->"Black",
White->"White",
Gray->"Gray",
Cyan->"Cyan",
Magenta->"Magenta",
Yellow->"Yellow",
Brown->"Brown",
Orange->"Orange",
Pink->"Pink",
Purple->"Purple"},
ControlType->PopupMenu},
Delimiter,
{{modify,False,Style["Korekta",20]},{False,True},ControlType->Checkbox},
{{cor,1,Style["",18]},{1->Style[" Lighter ",Gray,16],-1->Style[" Darker ",Black,16]},Enabled->If[modify,True,False]},
{{f,0.33,Style["Frakcja, f",20]},0,1,Appearance->"Labeled",LabelStyle->20,Enabled->modify},
(* Opcje i formatowania *)
FrameLabel->{None,None,Column[{Style[" Color, ","Output",24],Style["Lighter[Color,f], Darker[Color,f]","Output",24]},Center,Spacings->1],None},
TrackedSymbols:>{color,modify,cor,f}, Alignment->Center
],
Style["  RGBColor ",Black,22]->
Manipulate[
(*Wyrażenie którym manipulujemy*)
Column[{
Graphics[{RGBColor[r,g,b],Disk[{0,0}]},ImageSize->300],
Button[" Insert Color ",
NotebookWrite[Notebooks[][[2]],RGBColor[r,g,b]],
BaseStyle->{Bold,22},
ImageMargins->5]},Center],
(* Kontrolki *)
{{r,1,Style["R ",Red,22]},0,1,Appearance->"Labeled",LabelStyle->Directive[RGBColor[r,g,b],24]},
{{g,0,Style["G ",Green,22]},0,1,Appearance->"Labeled",LabelStyle->Directive[RGBColor[r,g,b],24]},
{{b,0,Style["B ",Blue,22]},0,1,Appearance->"Labeled",LabelStyle->Directive[RGBColor[r,g,b],24]},
(* Opcje i formatowania *)
FrameLabel->{None,None,Style["RGBColor[r, g, b]       ","Output",24],None},
TrackedSymbols:>{r,g,b},
ContentSize->{400,400},
Alignment->Center
],
Style["   Hue   ",Black,22]->
Manipulate[
(*Wyrażenie którym manipulujemy*)
Column[{
Graphics[{Hue[h,s,b],Disk[{0,0}]},ImageSize->300],
Button[" Insert Color ",
NotebookWrite[Notebooks[][[2]],Hue[h,s,b]],
BaseStyle->{Bold,22},
ImageMargins->5]},Center],
(* Kontrolki *)
{{h,0,Style["Hue ",Black,22]},0,1,Appearance->"Labeled",LabelStyle->Directive[Hue[h,s,b],22]},
{{s,1,Style["Saturation ",Black,22]},0,1,Appearance->"Labeled",LabelStyle->Directive[Hue[h,s,b],22]},
{{b,1,Style["Brightness ",Black,22]},0,1,Appearance->"Labeled",LabelStyle->Directive[Hue[h,s,b],22]},
(* Opcje i formatowania *)
FrameLabel->{None,None,Style["Hue[h, s, b]       ","Output",24],None},
TrackedSymbols:>{h,s,b},
Alignment->Center
],
Style["  Blend  ",Black,22]->
Manipulate[
(*Wyrażenie którym manipulujemy*)
Column[{
Graphics[{Blend[{c1,c2},f],Disk[{0,0}]},ImageSize->300],
Button[" Insert Color ",
NotebookWrite[Notebooks[][[2]],Blend[{c1,c2},f]],
BaseStyle->{Bold,22},
ImageMargins->5]},Center],
(* Kontrolki *)
{{c1,Red,Style["Kolor 1",22]},ColorSlider,ImageSize->{330,80}},
{{c2,Blue,Style["Kolor 2",22]}, ColorSlider,ImageSize->{330,80}},
Delimiter,
{{f,0,Style["Frakcja, f",22]},0,1,Appearance->"Labeled",LabelStyle->22},
(* Opcje i formatowania *)
FrameLabel->{None,None,Style["  Blend[k1,k2,f] = (1-f)*k1 + f*k2","Output",24],None},
TrackedSymbols:>{c1,c2,f},
Alignment->Center
]
}]

Wstawki do innego Notebooka

Wstawianie tekstu do innego Notebooka!
Niestaty, Button “Insert” nie działa w wersji CDF - nie można modyfikować innego Notebooka z poziomu CDF!

lnb=Notebooks[]

lnb[[2]]

NotebookWrite[lnb[[2]],"RGBColor[1,0,0]"]

Notebooks[]