kodi-community-addons / script.skin.helper.colorpicker Goto Github PK
View Code? Open in Web Editor NEWColorpicker for Kodi Skins. Part of Skin Helper Suite
License: GNU General Public License v2.0
Colorpicker for Kodi Skins. Part of Skin Helper Suite
License: GNU General Public License v2.0
I have a plugin that would benefit from using the ColorPicker as a module so that it can be easily invoked from the settings screen as well as allow me to overload methods for custom functionality.
I have this working by exposing resources/lib as a python module extension in addons.xml, and replacing all global constants with class properties that default to those global constants.
This is working great. I can easily supply my own color palette from within my non-skin addon, and I overloaded save_color_setting so that it saves values to the addon's settings.
I can submit a pull request if interested.
I've successfully used Skin Helper Service ColorPicker on 2 Android TV boxes, one running Kodi 18.1 and the other Kodi 19.3, but on a 3rd one with the latest Kodi 20.0 it installs fine, but when going to pick a custom colour (in Aeon Nox Silvo skin), it simply comes up with Skin Helper Service ColorPicker Error. I've tried to Install from zip using the latest download, and it tells me it was updated, but no change in behaviour. I've even manually replaced all the files, but it just prompted me to install the add-on again, and once again I can't use it. I've had a look online for a potential answer, but all I've seen is people mention it doesn't work with Kodi 20.0.
I've attached the log file, which mentions script.skin.helper.colorpicker numerous times, so if there is something I can manually edit in default.py or something, I'd happily do that to get this working. Also, I went to see if I could update it, but it isn't listed in the installed add-ons section, though it's definitely installed. Many thanks in advance.
kodi.log
Hi Marcel,
Whenever I open any dialog to change a colour and back out of that dialog without having changed any colour, the default colour is not applied. If am changing the background colour for instance this then becomes transparent. I checked this in other skins and they show the same behaviour.
Is there any way to prevent this?
Cheers,
Jeroen
2022-11-16 12:54:24.791 T:13048 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: module 'xbmc' has no attribute 'translatePath'
Traceback (most recent call last):
File "C:\Users\standard\AppData\Roaming\Kodi\addons\script.skin.helper.colorpicker\default.py", line 7, in
import resources.lib.ColorPicker as cp
File "C:\Users\standard\AppData\Roaming\Kodi\addons\script.skin.helper.colorpicker\resources\lib\ColorPicker.py", line 15, in
COLORFILES_PATH = xbmc.translatePath("special://profile/addon_data/%s/colors/" % ADDON_ID)
AttributeError: module 'xbmc' has no attribute 'translatePath'
-->End of Python script error report<--
Solution:
script.skin.helper.colorpicker\resources\lib\ColorPicker.py
replace lines 15, 16, and 17 with
COLORFILES_PATH = xbmcvfs.translatePath("special://profile/addon_data/%s/colors/" % ADDON_ID)
SKINCOLORFILES_PATH = xbmcvfs.translatePath("special://profile/addon_data/%s/colors/" % xbmc.getSkinDir())
SKINCOLORFILE = xbmcvfs.translatePath("special://skin/extras/colors/colors.xml")
only need to change xbmc.translatePath to xbmcfvs.translatePath, will solve.
2019-08-10 15:37:09.094 T:18446744073709551614 WARNING: Using iconImage in ListItem constructor results in NOP. Use setArt.
2019-08-10 15:37:09.399 T:18446744073709551614 WARNING: Previous line repeats 125 times.
2019-08-10 15:37:09.399 T:18446744073709551614 ERROR: XFILE::CDirectory::GetDirectory - Error getting
2019-08-10 15:37:10.422 T:18446744073709551614 ERROR: Previous line repeats 2 times.
2019-08-10 15:37:10.422 T:18446744073709551614 WARNING: Skin Helper Service ColorPicker --> Traceback (most recent call last):
File "C:\Program Files\Kodi\addons\script.skin.helper.colorpicker\resources\lib\ColorPicker.py", line 328, in create_color_swatch_image
a, r, g, b = [int(n, 16) for n in (a, r, g, b)]
ValueError: invalid literal for int() with base 16: 'li'
2019-08-10 15:37:10.422 T:18446744073709551614 ERROR: Skin Helper Service ColorPicker --> Exception in resources.lib.ColorPicker ! --> invalid literal for int() with base 16: 'li'
Probably caused by this code Kodi changed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.