ColorSlider

ColorSlider[color]

represents a color slider currently set to the color corresponding to color.

ColorSlider[Dynamic[color]]

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

ColorSlider[]

represents a color slider with an initial gray color.

Details and Options

  • ColorSlider[] displays in a notebook as a color slider that can be manipulated interactively.
  • ColorSlider[Dynamic[x]] will reset the value of x when the slider is moved; ColorSlider[x] will not.
  • The following options can be given:
  • AppearanceElements Automaticelements to include in the color slider
    AutoAction Falsewhether to change the color automatically when the mouse moves over the color slider
    BaselinePosition Automaticalignment relative to surrounding text
    BaseStyle{}base style specifications for the color slider
    Enabled Automaticwhether the color slider is enabled, or grayed out
    ImageMargins 0margins around the image of the displayed color slider
    ImageSize Automaticthe overall image size of the displayed color slider
  • A default color slider includes "Swatch" and "Spectrum" elements. Elements to use can be specified in any order in a list given as the setting for AppearanceElements.
  • Setting can be used to find the color specified by ColorSlider.
  • The settings for BaseStyle are appended to the default style typically given by the "ColorSlider" style in the current stylesheet.

Examples

open allclose all

Basic Examples  (1)

Dynamically set the variable to the selected color:

Scope  (1)

Copy and use Evaluate in Place () to display as an actual color slider:

Then use Setting to retrieve the RGB value of the color slider:

Options  (10)

AppearanceElements  (1)

Select which appearance element to include:

AutoAction  (2)

By default no colors change until you click in the slider area:

By setting AutoAction, the colors change as the mouse moves over the slider area:

BaselinePosition  (1)

Align with the surrounding text:

ContinuousAction  (2)

By default, variables are continuously updated:

Setting ContinuousAction to False makes variable updates only when the color slider is released:

Enabled  (2)

By default ColorSlider is enabled:

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

ImageMargins  (1)

Add margins:

ImageSize  (1)

Change the overall size:

Applications  (1)

Create a colorful drawing:

Properties & Relations  (1)

ColorSetter is a special case of ColorSlider:

Neat Examples  (1)

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_colorslider, organization={Wolfram Research}, title={ColorSlider}, year={2021}, url={https://reference.wolfram.com/language/ref/ColorSlider.html}, note=[Accessed: 22-December-2024 ]}