Giter Site home page Giter Site logo

abeksis / script.skin.helper.colorpicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kodi-community-addons/script.skin.helper.colorpicker

0.0 2.0 0.0 436 KB

Colorpicker for Kodi Skins. Part of Skin Helper Suite

License: GNU General Public License v2.0

Python 100.00%

script.skin.helper.colorpicker's Introduction

Skin Helper Service Color Picker

script.skin.helper.colorpicker

A Color picker to be used by Kodi skins

Usage: see below

RunScript(script.skin.helper.colorpicker,skinstring=XXX)

This command will open the color picker of the script. After the user selected a color, the color will be stored in the skin string.

Required parameter: skinstring: Skin String inwhich the value of the color (ARGB) will be stored.

In your skin you can just use the skin string to color a control, example: $INFO[Skin.String(defaultLabelColor)]

####Notes:

  1. If you want to display the name of the selected color, add a prefix .name to your skin string.

For example: Default color for labels: $INFO[Skin.String(defaultLabelColor.name)]

  1. If you want to customize the look and feel of the color picker window, make sure to include script-skin_helper_service-ColorPicker.xml in your skin and skin it to your needs.

  2. If you want to specify the header title of the color picker, make sure to include a label with ID 1 in the XML and add the header= parameter when you launch the script.

For example: RunScript(script.skin.helper.colorpicker,skinstring=MySkinString,header=Set the OSD Foreground Color)

  1. By default the colorpicker will provide a list of available colors. If you want to provide that list yourself, create a file "colors.xml" in skin\extras\colors\colors.xml See the default colors file in the script's location, subfolder resources\colors
Set a skinshortcuts property with the color

If you want to set a Window(home) Property instead of a skin settings:

RunScript(script.skin.helper.colorpicker,winproperty=XXX)

If you want to use the color picker to store the color in a shortcut-property from the skinshortcuts script, include a button in your script-skinshortcuts.xml with this onclick-action:

RunScript(script.skin.helper.colorpicker,shortcutproperty=XXX)

Multiple color palettes

The color picker supports having multiple color palettes in your colors.xml. The structure of your colors.xml file will then be layered, like this:

<colors>
    <palette name="mypalette1">
        <color name="color1">ffffffff</color>
    </palette>
</colors>

If you do not create the palette sublevel in your colors.xml, the script will just display all tags.

If you have specified multiple palettes you can use a button with ID 3030 to switch between color palettes.

Also it is possible to launch the color picker with a specific palette, in that case supply the palette= parameter when you open the picker, for example:

RunScript(script.skin.helper.colorpicker,skinstring=MySkinString,palette=mypalette1)

script.skin.helper.colorpicker's People

Contributors

marcelveldt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.