Users can define a new color by moving the mouse cursor over the color area or over the vertical color bar, shown in Figure 25-5. When the Custom Color window opens, it displays values of the color that is currently shown in the color indicator of the color chooser. The Custom Color dialog window is a modal window that can be opened by clicking the corresponding link in the color palette. The color chooser label renders the corresponding hexadecimal web color value. Each color selected in the palette or in the custom color area is displayed in the color indicator of the color chooser. The set of custom colors cannot be reloaded when the application starts again, unless saved within the application. The color palette supports navigation by using the Up, Down, Left and Right keys. If a custom color is already defined, this color is displayed in the Custom Color area in the color palette, as shown in Figure 25-4.įigure 25-4 Color Palette with the Custom Color Areaĭescription of "Figure 25-4 Color Palette with the Custom Color Area" The initial appearance of the color palette is shown in Figure 25-3.įigure 25-3 Initial Appearance of the Color Paletteĭescription of "Figure 25-3 Initial Appearance of the Color Palette" The color palette contains the predefined set of colors and the Custom Color link that points to the Custom Color dialog window. For more information about how to alter the appearance of a color picker, see Changing the Appearance of a Color Picker. To apply one of the looks, use the corresponding CSS classes. It also has a drop-down menu but it is not separated from the button part. The combo-box look is the default appearance of the color chooser. In the split-menu-button look, the button part of the control is separated from the drop-down menu. The button look provides a typical button control with the color indicator and the label. The implementation of the color picker control allows three looks of the color chooser element: button, split-menu-button, and combo box shown in Figure 25-2.ĭescription of "Figure 25-2 Views of a Color Chooser" The color indicator presents the currently selected color. The color chooser element of the color picker is the combo box with the enabled color indicator and the corresponding label shown at the top of Figure 25-1. Figure 25-1 shows these elements.įigure 25-1 Elements of a Color Picker Controlĭescription of "Figure 25-1 Elements of a Color Picker Control" The ColorPicker control consists of the color chooser, color palette, and custom color dialog window. The color picker control in the JavaFX SDK is a typical user interface component that enables users to select a particular color from the available range, or set an additional color by specifying an RGB or HSB combination. This chapter describes the ColorPicker control, provides its design overview, and explains how to use it in your JavaFX applications.
0 Comments
Leave a Reply. |