{ "cells": [ { "cell_type": "markdown", "id": "83cf219b", "metadata": {}, "source": [ "# Backgrounds and RYB paint mixing\n", "\n", "White / transparent canvases and subtractive **RYB** mixing. Concepts and\n", "figures: [color compositing](../guide/color_compositing.md). CMYK is\n", "API-only in the combine-mode dropdown pending GUI polishing — available as\n", "`combine_mode='cmyk'`.\n", "\n", "![RYB paint mix vs additive RGB](../_static/compositing/paintmix_demo_light.png)" ] }, { "cell_type": "code", "execution_count": null, "id": "7d04b552", "metadata": {}, "outputs": [], "source": [ "import multicolorfits as mcf" ] }, { "cell_type": "markdown", "id": "cbf52d54", "metadata": {}, "source": [ "## Backgrounds (preferred over `inverse=True`)\n", "\n", "Classic `combine_multicolor(..., inverse=True)` plus `hex_complement()` was the v2\n", "route to a light canvas. Prefer an explicit background:\n", "\n", "```python\n", "s.compose.combine_background = 'white'\n", "s.compose.combine_background = 'transparent'\n", "s.compose.combine_background = '#F5F0E6' # custom\n", "s.compose.facecolor = 'none' # transparent figure canvas when saving\n", "```\n", "\n", "In the browser GUI the Compositing tab exposes the same choices (and a\n", "side-by-side montage of white / RYB / transparent):\n", "[gui walkthrough](gui_web_walkthrough.md)." ] }, { "cell_type": "markdown", "id": "50d8bd1c", "metadata": {}, "source": [ "## RYB (paint-like subtractive)\n", "\n", "```python\n", "s.compose.combine_mode = 'ryb'\n", "# blend is ignored for RYB/CMYK — chroma mixes subtractively\n", "rgb = s.render_combined()\n", "```\n", "\n", "Or with the low-level helpers:\n", "\n", "```python\n", "rgb = mcf.combine_colorized_layers(colorized_list, mode='ryb', gamma=2.2)\n", "```\n", "\n", "Yellow + blue → green on the paint wheel (not cyan-ish white as in additive\n", "RGB). That is intentional. For additive Lab mixing that keeps hues distinct\n", "under bright overlaps, use `combine_mode='lab'` + `combine_blend='screen'`." ] }, { "cell_type": "markdown", "id": "e900a837", "metadata": {}, "source": [ "## When to use what\n", "\n", "| Goal | Setting |\n", "|------|---------|\n", "| General science color composite | Lab / screen |\n", "| Classic channel sum | RGB (`combine_multicolor`) |\n", "| Paint / ink aesthetic | RYB |\n", "| Print-ink invert feel | CMYK (API) |\n", "| Slides with irregular outline | transparent background + cutout export |" ] }, { "cell_type": "code", "execution_count": null, "id": "cc2fe807", "metadata": {}, "outputs": [], "source": [ "print('Backgrounds + RYB — see docs/guide/color_compositing.md')" ] } ], "metadata": { "jupytext": { "formats": "ipynb,py:percent", "kernelspec": { "display_name": "Python 3", "name": "python3" }, "main_language": "python" } }, "nbformat": 4, "nbformat_minor": 5 }