Flutter package for creating customisable Color pickers for HSV Colors.
The HuePicker
is used to let the user pick the hue of a HSVColor
by selecting it on the slider.
The height of the slider is customizable.
The slider thumb is as well completely customizable.
HuePicker(
initialColor: HSVColor.fromColor(Colors.green),
onChanged: (HSVColor color) {
// do something with color
},
)
// create controller
_controller = HueController(HSVColor.fromColor(Colors.green));
// use controller in HuePicker
HuePicker(
controller: _controller,
onChanged: (HSVColor color) {
// do something with color
},
)
// use controller to set the value of the HuePicker from outside the widget
_controller.value = HSVColor.fromColor(Colors.blue);
Customize the slider's height using trackHeight
:
HuePicker(
...
trackHeight: 50,
)
Customize the thumb by passing a thumbOverlayColor
and a custom thumbShape
:
HuePicker(
...
thumbOverlayColor: Colors.green.withOpacity(0.3),
thumbShape: HueSliderThumbShape(
color: Colors.black,
strokeWidth: 8,
filled: false,
showBorder: true
),
)
HueSliderThumbShape
offers the following properties for customisation:
radius
: the radius of the thumb (double)filled
: whether the thumb should be filled or not (bool)color
: main color of the thumbstrokeWidth
: stroke with for non-filled thumb (double)showBorder
: whether to show the border or not (bool)borderColor
: color of the border, if shownborderWidth
: stroke with of the border, if shown (double)
- Saturation Picker
- Brightness Picker
If you have any ideas for extending this package or have found a bug, please contribute!
- You'll need a GitHub account.
- Fork the hsv_color_pickers repository.
- Work on your feature/bug.
- Create a pull request.
- Star this project. ⭐
- Become a hero!! 🎉