Flask-Colorpicker


NameFlask-Colorpicker JSON
Version 0.11 PyPI version JSON
download
home_pagehttps://github.com/mrf345/flask_colorpicker/
Summarycolor picker flask extension
upload_time2025-08-08 21:09:40
maintainerNone
docs_urlNone
authorMohamed Feddad
requires_pythonNone
licenseMIT
keywords flask extension color picker spectrum colorpicker
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align='center'>flask_colorpicker</h1>
<h3 align='center'>
A Flask extension to add Spectrum jQuery color picker into the template, it makes adding and configuring multiple color pickers at a time much easier and less time consuming.
</h3>

## Install :
#### - With pip:
> - `pip install Flask-Colorpicker` <br />

#### - From the source:
> - `git clone https://github.com/mrf345/flask_colorpicker.git`<br />
> - `cd flask_colorpicker` <br />
> - `python setup.py install`

## Setup :
#### - Inside the Flask app:
```python
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask_colorpicker import colorpicker
app = Flask(__name__)
Bootstrap(app)
colorpicker(app)
```
#### - inside the jinja template
```jinja
{% extends 'bootstrap/base.html' %}
{% block scripts %}
  {{ super() }}
  {{ colorpicker.loader() }}
  {{ colorpicker.picker(ids=[".cp"]) }}
{% endblock %}
{% block content %}
  <form class="verticalform">
    <input type="text" class="form-control cp" />
  </form>
{% endblock %}
```

## Settings:
#### - Customize:
>The accepted arguments to be passed to the `colorpicker.picker()` function are as follow:
```python
def picker(self, ids=[".colorpicker"], # list of ids of element to assign colorpicker to
            default_color='rgb(0,0,255,0.5)', # default color to start with
            color_format='rgb', # color format to use
            showAlpha='true', # enable or disable transparency
            showInput='false', # display or hide color picker
            showButtons='false', # display or hide buttons
            allowEmpty='true'): # allow empty input
```

#### - Local source:
> by default the extension will load spectrum plugin from [a remote CDN][25530337]. Although you can configure that to be locally through passing a list of two files .js and .css into the colorpicker module like such:
```python
colorpicker(app=app, local=['static/js/spectrum.js', 'static/css/spectrum.css'])
```
 _The order in-which the items of list are passed is not of importance, it will be auto detected via file extension_

  [25530337]: https://cdnjs.com/libraries/spectrum "Spectrum CDN"

## Credit:
> - [Spectrum][33c1000c]: jQuery color picker.

  [33c1000c]: https://github.com/bgrins/spectrum "Spectrum  website"

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mrf345/flask_colorpicker/",
    "name": "Flask-Colorpicker",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "flask, extension, color, picker, spectrum, colorpicker",
    "author": "Mohamed Feddad",
    "author_email": "mrf345@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/92/3e/09e641a4c2b174d09562bcd3630a562ad10af5ba9be77c98f1e5e4edce14/flask_colorpicker-0.11.tar.gz",
    "platform": "any",
    "description": "<h1 align='center'>flask_colorpicker</h1>\n<h3 align='center'>\nA Flask extension to add Spectrum jQuery color picker into the template, it makes adding and configuring multiple color pickers at a time much easier and less time consuming.\n</h3>\n\n## Install :\n#### - With pip:\n> - `pip install Flask-Colorpicker` <br />\n\n#### - From the source:\n> - `git clone https://github.com/mrf345/flask_colorpicker.git`<br />\n> - `cd flask_colorpicker` <br />\n> - `python setup.py install`\n\n## Setup :\n#### - Inside the Flask app:\n```python\nfrom flask import Flask, render_template\nfrom flask_bootstrap import Bootstrap\nfrom flask_colorpicker import colorpicker\napp = Flask(__name__)\nBootstrap(app)\ncolorpicker(app)\n```\n#### - inside the jinja template\n```jinja\n{% extends 'bootstrap/base.html' %}\n{% block scripts %}\n  {{ super() }}\n  {{ colorpicker.loader() }}\n  {{ colorpicker.picker(ids=[\".cp\"]) }}\n{% endblock %}\n{% block content %}\n  <form class=\"verticalform\">\n    <input type=\"text\" class=\"form-control cp\" />\n  </form>\n{% endblock %}\n```\n\n## Settings:\n#### - Customize:\n>The accepted arguments to be passed to the `colorpicker.picker()` function are as follow:\n```python\ndef picker(self, ids=[\".colorpicker\"], # list of ids of element to assign colorpicker to\n            default_color='rgb(0,0,255,0.5)', # default color to start with\n            color_format='rgb', # color format to use\n            showAlpha='true', # enable or disable transparency\n            showInput='false', # display or hide color picker\n            showButtons='false', # display or hide buttons\n            allowEmpty='true'): # allow empty input\n```\n\n#### - Local source:\n> by default the extension will load spectrum plugin from [a remote CDN][25530337]. Although you can configure that to be locally through passing a list of two files .js and .css into the colorpicker module like such:\n```python\ncolorpicker(app=app, local=['static/js/spectrum.js', 'static/css/spectrum.css'])\n```\n _The order in-which the items of list are passed is not of importance, it will be auto detected via file extension_\n\n  [25530337]: https://cdnjs.com/libraries/spectrum \"Spectrum CDN\"\n\n## Credit:\n> - [Spectrum][33c1000c]: jQuery color picker.\n\n  [33c1000c]: https://github.com/bgrins/spectrum \"Spectrum  website\"\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "color picker flask extension",
    "version": "0.11",
    "project_urls": {
        "Download": "https://github.com/mrf345/flask_colorpicker/archive/0.11.tar.gz",
        "Homepage": "https://github.com/mrf345/flask_colorpicker/"
    },
    "split_keywords": [
        "flask",
        " extension",
        " color",
        " picker",
        " spectrum",
        " colorpicker"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5f0bc3a0687c4cd76f39834daebdc5659fa98b7c077bd762804def7e115470ac",
                "md5": "9810e41bfbe9df46e29acdb2bf095d2e",
                "sha256": "099f074cdd2388868937c0d6d2176c47eb98d4663e347674bce0eb765600e0cc"
            },
            "downloads": -1,
            "filename": "flask_colorpicker-0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9810e41bfbe9df46e29acdb2bf095d2e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5274,
            "upload_time": "2025-08-08T21:09:38",
            "upload_time_iso_8601": "2025-08-08T21:09:38.444805Z",
            "url": "https://files.pythonhosted.org/packages/5f/0b/c3a0687c4cd76f39834daebdc5659fa98b7c077bd762804def7e115470ac/flask_colorpicker-0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "923e09e641a4c2b174d09562bcd3630a562ad10af5ba9be77c98f1e5e4edce14",
                "md5": "c29d84a45a11ed73e72cfd9990637518",
                "sha256": "fbb56ed68ef10e7d56e987c86a58e04608a205ffa45914297d357bdaea512539"
            },
            "downloads": -1,
            "filename": "flask_colorpicker-0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "c29d84a45a11ed73e72cfd9990637518",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5076,
            "upload_time": "2025-08-08T21:09:40",
            "upload_time_iso_8601": "2025-08-08T21:09:40.088172Z",
            "url": "https://files.pythonhosted.org/packages/92/3e/09e641a4c2b174d09562bcd3630a562ad10af5ba9be77c98f1e5e4edce14/flask_colorpicker-0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-08 21:09:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mrf345",
    "github_project": "flask_colorpicker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flask-colorpicker"
}
        
Elapsed time: 2.43413s