install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/gay-julia" ~/.claude/skills/plurigrid-asi-gay-julia-56af2d && rm -rf "$T"
manifest:
skills/gay-julia/SKILL.mdsource content
Gay.jl - Wide-Gamut Deterministic Color Sampling
Wide-gamut color sampling with splittable determinism using Pigeons.jl SPI pattern and LispSyntax integration.
Repository
- Source: https://github.com/bmorphism/Gay.jl
- Language: Julia
- Pattern: SplitMix64 → GF(3) trits → LCH colors
Core Concepts
SplitMix64 Determinism
# Deterministic color from seed using Gay seed = 0x598F318E2B9E884 color = gay_color(seed) # Returns LCH color trit = gf3_trit(seed) # Returns :MINUS, :ERGODIC, or :PLUS
GF(3) Conservation
Every color operation preserves the tripartite balance:
- MINUS (-1): Contractive operations
- ERGODIC (0): Neutral/balanced operations
- PLUS (+1): Expansive operations
Sum of trits across parallel streams must equal 0 (mod 3).
LispSyntax Integration
using LispSyntax # S-expression colorization sexp = @lisp (defun factorial (n) (if (<= n 1) 1 (* n (factorial (- n 1))))) colored = colorize(sexp, seed=seed)
Integration with plurigrid/asi
With gay-mcp skill
# MCP tool registration with deterministic colors using Gay, MCP tool = MCPTool("color-palette", seed=0x1069) palette = generate_palette(tool, n=5)
With spi-parallel-verify
# Verify GF(3) conservation across parallel execution using Gay, SPI streams = trifurcate(seed, [:task1, :task2, :task3]) verify_conservation(streams) # Asserts sum(trits) ≡ 0 (mod 3)
With triad-interleave
# Interleave three color streams using Gay, TriadInterleave schedule = interleave( minus_stream(seed), ergodic_stream(seed), plus_stream(seed) )
Key Functions
| Function | Description |
|---|---|
| Generate LCH color from seed |
| Extract GF(3) trit assignment |
| Advance RNG state |
| Color S-expression nodes |
| Generate n-color palette |
Use Cases
- Deterministic UI theming - Same seed → same colors everywhere
- Parallel task coloring - GF(3) ensures balanced distribution
- CRDT conflict resolution - Trit-based merge ordering
- Terminal session coloring - vterm integration via crdt-vterm-bridge
Related Skills
- MCP server with Gay.jl colorsgay-mcp
- Strong Parallelism Invariance verificationspi-parallel-verify
- Three-stream schedulingtriad-interleave
- GF(3) conservation in game semanticsbisimulation-game