2020-01-23 06:44:28 -05:00
|
|
|
package zenity
|
|
|
|
|
|
|
|
import "image/color"
|
|
|
|
|
|
|
|
// SelectColor displays the color selection dialog.
|
|
|
|
//
|
2022-06-02 07:24:24 -04:00
|
|
|
// Valid options: Title, WindowIcon, Attach, Modal, Color, ShowPalette.
|
2022-03-25 20:58:27 -04:00
|
|
|
//
|
|
|
|
// May return: ErrCanceled.
|
2020-01-23 06:44:28 -05:00
|
|
|
func SelectColor(options ...Option) (color.Color, error) {
|
2021-03-04 07:42:30 -05:00
|
|
|
return selectColor(applyOptions(options))
|
2020-01-23 06:44:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Color returns an Option to set the color.
|
|
|
|
func Color(c color.Color) Option {
|
2020-01-24 07:52:45 -05:00
|
|
|
return funcOption(func(o *options) { o.color = c })
|
2020-01-23 06:44:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// ShowPalette returns an Option to show the palette.
|
|
|
|
func ShowPalette() Option {
|
2020-01-24 07:52:45 -05:00
|
|
|
return funcOption(func(o *options) { o.showPalette = true })
|
2020-01-23 06:44:28 -05:00
|
|
|
}
|