ColorSetter

ColorSetter[color]

represents a color setter which displays as a swatch of the specified color and when clicked brings up a system color picker dialog.

ColorSetter[Dynamic[color]]

uses the dynamically updated current value of color, with the value of color being reset if the color is modified.

ColorSetter[]

gives a color setter with initial color gray.

Details and Options

  • The following options can be given:
  • AutoAction Falsewhether to automatically open the color picker dialog when the mouse is over the color setter
    BaselinePosition Automaticalignment relative to surrounding text
    BaseStyle{}base style specifications for the color setter
    Enabled Automaticwhether the color setter is enabled, or grayed out
    ImageMargins 0margins around the image of the displayed color setter
    ImageSize Automaticthe overall image size of the displayed color setter
  • The settings for BaseStyle are appended to the default style typically given by the "ColorSetter" style in the current stylesheet.
  • Setting can be used to find the color specified by ColorSetter.

Examples

open allclose all

Basic Examples  (1)

Use Pink as the initial value:

Dynamically change :

Scope  (1)

The ColorSetter can be included in graphics:

Options  (5)

AutoAction  (1)

By default, ColorSetter must be clicked to bring up the color dialog:

By setting AutoAction, the color dialog comes up as the mouse moves over the setter area:

BaselinePosition  (1)

Align with surrounding text:

Enabled  (1)

By default, ColorSetter is enabled:

By setting Enabled->False, the setter is disabled but visible in its current state:

ImageMargins  (1)

Add margins to the color setter:

ImageSize  (1)

Control the overall size of the color setter:

Applications  (1)

Dynamically use the setting to color graphics elements:

Properties & Relations  (1)

ColorSetter is a special case of ColorSlider:

Wolfram Research (2007), ColorSetter, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorSetter.html (updated 2021).

Text

Wolfram Research (2007), ColorSetter, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorSetter.html (updated 2021).

CMS

Wolfram Language. 2007. "ColorSetter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ColorSetter.html.

APA

Wolfram Language. (2007). ColorSetter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorSetter.html

BibTeX

@misc{reference.wolfram_2024_colorsetter, author="Wolfram Research", title="{ColorSetter}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ColorSetter.html}", note=[Accessed: 06-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_colorsetter, organization={Wolfram Research}, title={ColorSetter}, year={2021}, url={https://reference.wolfram.com/language/ref/ColorSetter.html}, note=[Accessed: 06-October-2024 ]}