Skip to content

Instantly share code, notes, and snippets.

View facelessuser's full-sized avatar
💭
Screaming into the void 😱

Isaac Muse facelessuser

💭
Screaming into the void 😱
View GitHub Profile
@facelessuser
facelessuser / oklab.json
Created April 13, 2023 02:21
Oklab Plotly JSON
This file has been truncated, but you can view the full file.
{"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
@facelessuser
facelessuser / okhsl_p3.py
Last active April 14, 2023 02:40
Okhsl P3
# 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
@facelessuser
facelessuser / confusion.py
Last active March 8, 2023 05:14
Lines of Confusion
# 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
@facelessuser
facelessuser / lms.py
Last active March 6, 2023 05:58
LMS Plugin using Smith & Pokorny (1975) 2-deg cone fundamentals
# 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 = [
@facelessuser
facelessuser / pycon.py
Last active January 3, 2024 13:48
Python Console Execution for SuperFences
"""
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
@facelessuser
facelessuser / LICENSE.md
Last active May 29, 2023 18:14
APCA Color Contrast

— LICENSE —

W3 License for Compliant Code Only

IMPORTANT: please see the APCA integration compliance doc.

The Short Summary, TL;DR:

Files in this repository are licensed to the W3/AGWG under their cooperative agreement for use with WCAG accessibility guidelines for web-delivered and web-based content only, and not for any other use. Certain limitations do apply.

Use of the terms "SAPC", "SACAM", "APCA", "Advanced Perceptual Contrast Algorithm", "Accessible Perceptual Contrast Algorithm", to describe any contrast method, app, or device, is only permitted for code that is correctly implemented, maintained, and up to date, per the APCA integration compliance page.

Code or implementations found to be non-compliant with APCA, meaning they are incorrect in operation or methodology as defined for APCA contrast, including but not limited to the indication of polarity, and use

@facelessuser
facelessuser / random_harmony.md
Last active May 25, 2023 13:01
Random Harmonies

Random color harmony generator.

Available harmonies are:

Harmony Description
mono Monochromatic
complement Complementary
split Split Complementary
analogous Analogous
@facelessuser
facelessuser / Defult.sublime-commands
Created December 5, 2022 14:43
Sublime Wildcard Navigation
[
{
"caption": "Wildcard Navigation",
"command": "wildcard_nav"
}
]
@facelessuser
facelessuser / example.py
Created September 12, 2022 20:41
example
inputs = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
colors = Color.steps(inputs, steps=10, space='srgb')
HtmlRow(colors)
HtmlRow([c.filter('brightness', 0.5).clip() for c in colors])
HtmlRow([c.filter('saturate', 0.5).clip() for c in colors])
HtmlRow([c.filter('contrast', 1.2).clip() for c in colors])
HtmlRow([c.filter('opacity', 0.5).clip() for c in colors])
HtmlRow([c.filter('invert', 1).clip() for c in colors])
HtmlRow([c.filter('hue-rotate', 90).clip() for c in colors])
HtmlRow([c.filter('sepia', 1).clip() for c in colors])
@facelessuser
facelessuser / cam16.py
Last active January 19, 2023 15:58
ColorAide CAM16
"""CAM16 class."""
import math
from coloraide.spaces import Space, Labish
from coloraide.distance import DeltaE
from coloraide.cat import WHITES
from coloraide.channels import Channel, FLG_ANGLE
from coloraide import util
from coloraide import algebra as alg
from coloraide.types import Vector, VectorLike
from typing import Optional