/// tab | Tab 1
//// tab | Tab A content ////
//// tab | Tab B content //// ///
| from coloraide import Color as Base | |
| class Color(Base): | |
| FIT = 'oklch-chroma' | |
| POWERLESS = True | |
| CARRYFORWARD = True | |
| print('==== Case 1 ====') | |
| color = Color.interpolate(['oklch(100% 50% 60deg)', 'oklch(50% 50% 0deg)'], space='oklch', out_space='oklch')(0.5) | |
| Row([color.to_string(percent=True), color.convert('srgb').to_string()]) |
/// tab | Tab 1
//// tab | Tab A content ////
//// tab | Tab B content //// ///
DPS Contrast, also known as Delta Phi Star, is a simple formula for predicting human visual perception of contrast between text and background.
WHAT WHERE HOW
UNIFORMITY:
DPS Contrast is quasi-uniform for human perception of text against a background on a self-illuminated display
| # pragma: init | |
| """Custom sRGB color class.""" | |
| from coloraide import Color as Base | |
| from coloraide.spaces.srgb.css import sRGB | |
| from coloraide.css import serialize | |
| from coloraide import algebra as alg | |
| import re | |
| RE_CUSTOM = re.compile(r'(?i)\b([a-z][a-z_]{2,})\b') |
"""XYB color space."""
from __future__ import annotations
from coloraide import algebra as alg
from coloraide.spaces import Space
from coloraide.types import Vector
from coloraide.cat import WHITES
from coloraide.channels import Channel, FLG_MIRROR_PERCENT
from coloraide import Color as Base| {"data":[{"facecolor":["rgb(111, 243, 0)","rgb(118, 243, 0)","rgb(117, 241, 0)","rgb(110, 241, 0)","rgb(112, 246, 0)","rgb(113, 249, 0)","rgb(113, 249, 0)","rgb(122, 251, 0)","rgb(255, 221, 129)","rgb(255, 224, 127)","rgb(108, 238, 0)","rgb(108, 238, 0)","rgb(114, 236, 0)","rgb(108, 238, 0)","rgb(114, 236, 0)","rgb(106, 233, 0)","rgb(100, 73, 0)","rgb(100, 76, 0)","rgb(195, 142, 0)","rgb(195, 148, 0)","rgb(197, 149, 0)","rgb(195, 142, 0)","rgb(197, 149, 0)","rgb(200, 145, 0)","rgb(255, 221, 186)","rgb(255, 222, 183)","rgb(255, 255, 255)","rgb(255, 254, 252)","rgb(161, 49, 0)","rgb(159, 48, 0)","rgb(144, 48, 0)","rgb(141, 47, 0)","rgb(146, 53, 0)","rgb(144, 48, 0)","rgb(5, 2, 0)","rgb(5, 2, 0)","rgb(255, 227, 209)","rgb(255, 224, 206)","rgb(255, 255, 255)","rgb(255, 254, 252)","rgb(255, 231, 140)","rgb(255, 231, 140)","rgb(255, 221, 132)","rgb(255, 221, 132)","rgb(255, 221, 132)","rgb(255, 225, 132)","rgb(255, 228, 155)","rgb(255, 227, 152)","rgb(255, 226, 135)","rgb(255, 226, 137)","rgb(255, 251, 247)","rgb(2 |
| # pragma: init | |
| """ | |
| Okhsl/Okhsv class. | |
| Adapted to Python and ColorAide and adjusted to P3 by Isaac Muse 2023. | |
| ---- License ---- | |
| Copyright (c) 2021 Björn Ottosson |
| # pragma: init | |
| from coloraide import Color as Base | |
| from coloraide.cat import WHITES | |
| from coloraide.spaces import Space | |
| from coloraide import algebra as alg | |
| from coloraide.types import Vector | |
| from coloraide.channels import Channel | |
| from coloraide import Color as Base | |
| # pragma: init | |
| """Convert Linear sRGB to LMS using Smith & Pokorny (1975) 2-deg cone fundamentals.""" | |
| from __future__ import annotations | |
| from coloraide.cat import WHITES | |
| from coloraide.spaces import Space | |
| from coloraide import algebra as alg | |
| from coloraide.types import Vector | |
| from coloraide.channels import Channel | |
| LRGB_TO_LMS = [ |
| """ | |
| Execute Python code in code blocks and construct a interactive Python console output. | |
| This allows you to write code examples, but then execute them, showing the results. | |
| https://github.com/facelessuser/pymdown-extensions/issues/1690 | |
| --- | |
| MIT License |