Question: I am designing an App and I want to use the "Choose Color Scheme" tools inside Button.

[![enter image description here](https://i.stack.imgur.com/EBbzL.jpg)](https://i.stack.imgur.com/EBbzL.jpg)

I am looking to have this tool in popup window when the Button is clicked but I can't find the command to get this tools.

Any help?

Thank you

Answer: 
Do you mean

```
Button[
 Tooltip["click", 
  Column[{"Click this button to select a ColorScheme.", 
    "This button will be replaced with ColorData"}]],
 With[{box = EvaluationBox[]}, SelectionMove[box, All, Expression];
  FrontEndExecute@
   FrontEnd`AttachCell[box, 
    FrontEndResource["ColorSchemeSelector"], {1, {Right, Top}}, {Left, Top}, 
   "ClosingActions" -> {"SelectionDeparture", "ParentChanged", "EvaluatorQuit"}]]]

```

[![GIF](https://i.stack.imgur.com/JwHgo.gif)](https://i.stack.imgur.com/JwHgo.gif)

---

Based on [a comment by the OP](https://mathematica.stackexchange.com/questions/120999/how-to-access-choose-color-scheme-programmatically/121000?noredirect=1#comment327974_121000) a `PopupMenu` might be more suitable.

```
DynamicModule[{colorScheme = "Rainbow"}, 
 Row[{PopupMenu[Dynamic[colorScheme], 
    Thread[ColorData["Gradients"] -> 
      MapThread[
       Column[{Style[#1, 9], #2}, Left, 0] &, 
       {ColorData["Gradients"],
         LinearGradientImage[#, {700, 100}] & /@ ColorData["Gradients"]}]]], 
   Spacer[10], 
   Dynamic[colorScheme]}]]

```

[![GIF2](https://i.stack.imgur.com/zOgqc.gif)](https://i.stack.imgur.com/zOgqc.gif)
Here is a modification of Karsten's answer attempting to get the behavior you described in a comment.

* The selected value is assigned to `Global`$color` (as shown by `Dynamic`)
* I made the picker wider to get rid of the annoying bottom scroll bar

Code:

```
Button["Pick a color",
 Module[{picker, box = EvaluationBox[]},

  picker = FrontEndResource["ColorSchemeSelector"] /. {
     _FrontEndExecute :> (Global`$color = First @ $CellContext`gsel$$),
     {180, Automatic} -> {195, Automatic}
   };

  SelectionMove[box, All, Expression];

  FrontEnd`AttachCell[box, picker, {1, {Right, Top}}, {Left, Top}
    , "ClosingActions" -> {"SelectionDeparture", "ParentChanged", "EvaluatorQuit"}
  ] // FrontEndExecute

 ]
]

Dynamic[Global`$color]

```

[![enter image description here](https://i.stack.imgur.com/4lfJq.png)](https://i.stack.imgur.com/4lfJq.png)

---

In a comment below [Kuba](https://mathematica.stackexchange.com/users/5478/kuba) offered a cleaner implementation using a [`DialogInput`](http://reference.wolfram.com/language/ref/DialogInput.html); here is a copy for preservation and easier reading. (comments lose tabulation.)

(Now with a correction from Karsten.)

```
Button["Pick a color",
  $color =
    DialogInput[
      RawBoxes @ FrontEndResource["ColorSchemeSelector"][[1, 1]] /. {
       _FrontEndExecute :> DialogReturn[First @ $CellContext`gsel$$],
       {180, Automatic} -> {195, Automatic},
       _NotebookDelete  :> DialogReturn[$Canceled]
      }
    ]
  , Method -> "Queued"
]

```