New ColorButton and DialogColorPicker.xml
#1
How do I use the new Kodi 20 colorbutton and DialogColorPicker.xml

I can add a colorbutton to my skin and have created a DialogColorPicker.xml but when I call it using ActivateWindow(DialogColorPicker) from my colorbutton no color values show up in the picker. 

So how do I:-

1. Define the colors to show in the picker
2. Get the color value back from the picker to use in my skin
Reply
#2
I think the colors are defined in core and the colorbutton only works for core?


scott s.
.
Reply
#3
it can currently be used by core and also by python addons.

i'm working on an implementation for skins, which is almost done... except for one brick wall i keep hitting.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
@ronie, Thanks, it would be a great control for skinners to allow users to customize there skin colours.
Reply
#5
Hi, @ronie any update regarding this?

I see you have an open pull request for this:- https://github.com/xbmc/xbmc/pull/20916
Reply
#6
@roidy i'll merge it, just for you ;-)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#7
(2022-02-12, 23:29)ronie Wrote: @roidy i'll merge it, just for you ;-)

Ah! Just for me.... So kind, thank you  Blush
Reply
#8
@ronie,
The only thing missing for me to be able to replace completely the colorpicker addon is the ability to set the opacity of the color. Is this something you are planning to add?

Regards,

Bart
Amber Maintainer
Main HTPC: Intel Core i7, 32GB, nVidia GTX1080, Windows 11 Soundbar: Samsung HW-Q950A TV: LG CX Kodi: 19.3 Skin: Amber
Reply
#9
You could use a fade animation on the control using it.
Reply
#10
@roidy

Did you ever work out the answer to that second question? Perhaps have some sample code you could point me to? thx
Reply
#11
(2024-07-20, 15:40)nonJon Wrote: @roidy

Did you ever work out the answer to that second question? Perhaps have some sample code you could point me to? thx

Just do a call to Skin.SetColor:- https://xbmc.github.io/docs.kodi.tv/mast...n_SetColor

Code:
<control type="colorbutton">
  <label>Select background colour</label>
  <colorbox>$INFO[Skin.String(bkgcolor)]</colorbox>
  <onclick>Skin.SetColor(bkgcolor,$LOCALIZE[whatever_value])</onclick>
</control>

The second param needs to be a localized string, just entering a text string doesn't work.

This button should pop up the color picker dialog and return the color value in the skin string bkgcolor. You can use any type of button, it doesn't need to be a colorbutton, the key part is the call to Skin.SetColor.
Reply
#12
Thank you sir!
Reply

Logout Mark Read Team Forum Stats Members Help
New ColorButton and DialogColorPicker.xml0