{"id":15024961,"url":"https://github.com/mrf345/flask_colorpicker","last_synced_at":"2025-04-12T13:11:19.150Z","repository":{"id":57430205,"uuid":"111929860","full_name":"mrf345/flask_colorpicker","owner":"mrf345","description":"A Flask extension for Spectrum javascript color picker","archived":false,"fork":false,"pushed_at":"2021-10-09T18:22:08.000Z","size":39,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T07:43:05.653Z","etag":null,"topics":["color","extension","flask","picker","python","spectrum"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrf345.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-24T14:59:12.000Z","updated_at":"2021-09-28T11:51:03.000Z","dependencies_parsed_at":"2022-08-26T04:43:23.317Z","dependency_job_id":null,"html_url":"https://github.com/mrf345/flask_colorpicker","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrf345%2Fflask_colorpicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrf345%2Fflask_colorpicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrf345%2Fflask_colorpicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrf345%2Fflask_colorpicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrf345","download_url":"https://codeload.github.com/mrf345/flask_colorpicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571883,"owners_count":21126522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["color","extension","flask","picker","python","spectrum"],"created_at":"2024-09-24T20:01:16.883Z","updated_at":"2025-04-12T13:11:19.119Z","avatar_url":"https://github.com/mrf345.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003eflask_colorpicker\u003c/h1\u003e\n\u003ch3 align='center'\u003e\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\u003c/h3\u003e\n\n## Install :\n#### - With pip:\n\u003e - `pip install Flask-Colorpicker` \u003cbr /\u003e\n\n#### - From the source:\n\u003e - `git clone https://github.com/mrf345/flask_colorpicker.git`\u003cbr /\u003e\n\u003e - `cd flask_colorpicker` \u003cbr /\u003e\n\u003e - `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  \u003cform class=\"verticalform\"\u003e\n    \u003cinput type=\"text\" class=\"form-control cp\" /\u003e\n  \u003c/form\u003e\n{% endblock %}\n```\n\n## Settings:\n#### - Customize:\n\u003eThe 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\u003e 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\u003e - [Spectrum][33c1000c]: jQuery color picker.\n\n  [33c1000c]: https://github.com/bgrins/spectrum \"Spectrum  website\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrf345%2Fflask_colorpicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrf345%2Fflask_colorpicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrf345%2Fflask_colorpicker/lists"}