kopia lustrzana https://github.com/sepandhaghighi/samila
Point colors doc (#147)
* add : image 8 added. * add : section 'Point Color'. * log: changes logged. * update : readme updated. * log : changes logged. * fix : minor typo fixed. * edit : README.md edited. * log : changes logged. * update : `demo.ipynb` updated. * log : changes logged.pull/149/head
rodzic
c254e0cfd8
commit
750d126bd6
|
@ -5,7 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Addded
|
||||
- `Point Color` section to `demo.ipynb`
|
||||
- `Point Color` section to `README.md`
|
||||
### Changed
|
||||
- `README.md` updated
|
||||
- `demo.ipynb` updated
|
||||
- `cmap` parameter added to `plot` method
|
||||
- Random mode modified
|
||||
- Test system modified
|
||||
|
|
22
README.md
22
README.md
|
@ -181,8 +181,30 @@ Samila is a generative art generator written in Python, Samila let's you create
|
|||
4. Random (example: `color="random"`)
|
||||
5. Complement (example: `color="complement", bgcolor="blue"`)
|
||||
6. Transparent (example: `bgcolor="transparent"`)
|
||||
7. List (example: `color=["black", "#fffeef",...]`)
|
||||
|
||||
⚠️ **Transparent** mode is only available for background
|
||||
⚠️ **List** mode is only available for color
|
||||
⚠️ In **List** mode, the length of this list must be equal to the lengths of data1 and data2.
|
||||
|
||||
#### Point Color
|
||||
```pycon
|
||||
>>> colorarray = [
|
||||
... [0.7, 0.2, 0.2, 1],
|
||||
... [0.6, 0.3, 0.2, 1],
|
||||
... "black",
|
||||
... [0.4, 0.4, 0.3, 1],
|
||||
... [0.3, 0.4, 0.4, 1],
|
||||
... "#ff2561"]
|
||||
>>> g.generate()
|
||||
>>> g.seed
|
||||
454893
|
||||
>>> g.plot(cmap=colorarray, color=g.data2, projection=Projection.POLAR)
|
||||
>>> plt.show()
|
||||
```
|
||||
<img src="https://github.com/sepandhaghighi/samila/raw/master/otherfiles/images/8.png">
|
||||
|
||||
You can make your custom color map and use it in Samila.
|
||||
|
||||
### Regeneration
|
||||
```pycon
|
||||
|
|
|
@ -155,6 +155,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"* Supported colors are available in `VALID_COLORS` list\n",
|
||||
"* `color` and `bgcolor` parameters supported formats:\n",
|
||||
"\n",
|
||||
" 1. Color name (example: `color=\"yellow\"`)\n",
|
||||
|
@ -163,8 +164,40 @@
|
|||
" 4. Random (example: `color=\"random\"`)\n",
|
||||
" 5. Complement (example: `color=\"complement\", bgcolor=\"blue\"`)\n",
|
||||
" 6. Transparent (example: `bgcolor=\"transparent\"`)\n",
|
||||
" 7. List (example: `color=[\"black\", \"#fffeef\",...]`)\n",
|
||||
"\n",
|
||||
"⚠️ **Transparent** mode is only available for background"
|
||||
"⚠️ **Transparent** mode is only available for background\n",
|
||||
"\n",
|
||||
"⚠️ **List** mode is only available for color\n",
|
||||
"\n",
|
||||
"⚠️ In **List** mode, the length of this list must be equal to the lengths of data1 and data2."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Point Color\n",
|
||||
"\n",
|
||||
"You can make your custom color map and use it in Samila."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"colorarray = [\n",
|
||||
" [0.7, 0.2, 0.2, 1],\n",
|
||||
" [0.6, 0.3, 0.2, 1],\n",
|
||||
" \"black\",\n",
|
||||
" [0.4, 0.4, 0.3, 1],\n",
|
||||
" [0.3, 0.4, 0.4, 1],\n",
|
||||
" \"#ff2561\"]\n",
|
||||
"g2.generate()\n",
|
||||
"g2.plot(cmap=colorarray, color=g2.data2, projection=Projection.POLAR)\n",
|
||||
"plt.show()"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -336,7 +369,7 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 3.8.10 64-bit",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
@ -350,9 +383,14 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2"
|
||||
"version": "3.8.10"
|
||||
},
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
}
|
||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 403 KiB |
Ładowanie…
Reference in New Issue