A colour picker for Wagtail's DraftJS editor.
I basically poached the starting point for this from https://github.com/Vadim-Karpenko/wagtailcolourpicker but there were a few problems with it that prevented it from working with the latest version of Wagtail (which at the time of writing was 4.2). I think I have got it working now but really it does need some decent community testing. The rest of the documentation below is basically from his GitHub repository.
pip install git+https://github.com/Vadim-Karpenko/wagtailcolourpicker.git@master
gh repo clone kiwiheretic/wagtailcolourpicker
Add to installed app:
INSTALLED_APPS = [
...
'wagtailcolourpicker',
...
]
WAGTAILCOLOURPICKER_ICON = ['...']
WAGTAILCOLOURPICKER_COLOURS = {
'black': '#000000',
'white': '#ffffff'
}
Add into your models.py
# Add all colors from 'wagtailcolourpicker'
# list names into your RichTextField(features=[get_list_features_name()]
body.features += get_list_colour_features_name()
Can be found on readthedocs <http://wagtailcolourpicker.readthedocs.io/>
_.
.. figure:: http://wagtailcolourpicker.readthedocs.io/en/latest/_images/screen_1.png :width: 728 px
Picker
.. figure:: http://wagtailcolourpicker.readthedocs.io/en/latest/_images/screen_2.png :width: 728 px
Selected Text
Clone the repo
.. code:: bash
$ git clone https://github.com/AccentDesign/wagtailcolourpicker.git
Run the docker container
.. code:: bash
$ cd wagtailcolourpicker
$ docker-compose up
Create yourself a superuser
.. code:: bash
$ docker-compose exec app bash
$ python manage.py createsuperuser
Go to http://127.0.0.1:8000/cms and add a new basic page