fltkhs-themes-0.1.0.2: A set of themed widgets that provides drop in replacements to the ones in FLTKHS.

Graphics.UI.FLTK.Theme.Light.ColorChooser

Contents

Synopsis

Drawing routines

Bounds of the color chooser subcomponents

Constructors

 ColorChooserComponentBounds FieldscolorChooserHueBoxBounds :: RectangleThe bounds of the hue boxcolorChooserSliderBounds :: RectangleThe bounds of the saturation slidercolorChooserPreviewPaneBounds :: RectangleThe bounds of the byte/hex/decimal color readout and color swatch preview pane.
Instances
 Source # Instance details Methods

Layout of color chooser subcomponents

Constructors

 ColorChooserComponentLayout FieldspaddingWidthPercentage :: DoubleLeft/right paddingpaddingHeightPercentage :: DoubleTop/bottom paddingbetweenPaddingPercent :: Double% of color chooser width to set as padding between subcomponentshueBoxWidthPercentage :: Double% of color chooser width dedicated to the hue boxsliderWidthPercentage :: Double% of color chooser width dedicated to the saturation sliderhueBoxHandleRadius :: DoubleRadius of the indicator you drag around the hue box to change colorpreviewPanePercentage :: Double% of color chooser width dedicated to the preview pane
Instances
 Source # Instance details Methods

The state of color chooser, passed around as in IORef and updated in callbacks, etc.

Instances
 Source # Instance details MethodsshowList :: [ColorChooserState] -> ShowS #

React to changes the dials in the preview pane

Draw the hue box subcomponent in the given Box, takes the Double indicator handle radius, the Int slider gauge height so it can align itself with it.

Draw the saturation slider using the current color to fill in the background image

Calculate the bounds of the saturation slider

Generate the hue box image

Generate the background of the saturation slider

Handle all events inside the hue box given the Double indicator radius and the Int gauge height.

Calculate the bounds of the hue box based on the overall Rectangle bounds, the Double radius of the indicator circle (half the indicator circle can be outside the box so the center is always within it), and the Int saturation slider height so the hue box can position itself accordingly.

Calculate the overall bounds of all the subcomponents

The default layout of color chooser subcomponents

Max width of the saturation slider if the color chooser is resized

Update the dials if the preview mode is changed from RGB->Hex->HSV->Byte mode

Set the dials according the selected color

React to changes in the saturation slider

Update all the controls based on the dial selected HSV

Update all the controls based on the dial selected RGB value