Skip to content
gay-mcp logo

Gay-MCP Skill: Deterministic Color Generation

gay-mcp

Deterministic color generation with SplitMix64, GF(3) trits, and MCP tools for palettes and threads.

SKILL.md

Full skill instructions

<!-- Propagated to codex | Trit: 0 | Source: .ruler/​skills/​gay-mcp -->

Gay-MCP Skill: Deterministic Color Generation

Status: ✅ Production Ready Trit: +1 (PLUS - optimistic/​generative) Principle: Same seed → Same colors (SPI guarantee) Implementation: Gay.jl (Julia) + SplitMixTernary (Ruby)


Overview

Gay-MCP provides deterministic color generation via SplitMix64 + golden angle. Every invocation with the same seed produces identical colors, enabling:

  1. Parallel computation: Fork generators, get same results
  2. Reproducibility: Colors are functions of (seed, index)
  3. GF(3) trits: Each color maps to {-1, 0, +1}

Core Algorithm

SplitMix64:
  state = (state + γ) mod 2⁶⁴
  z = state
  z = (z ⊕ (z >> 30)) × 0xBF58476D1CE4E5B9
  z = (z ⊕ (z >> 27)) × 0x94D049BB133111EB
  return z ⊕ (z >> 31)

Color Generation:
  L = 10 + random() × 85    # Lightness: 10-95
  C = random() × 100        # Chroma: 0-100
  H = random() × 360        # Hue: 0-360
  trit = hue_to_trit(H)     # GF(3) mapping

Constants

GOLDEN = 0x9E3779B97F4A7C15  # φ⁻¹ × 2⁶⁴
MIX1   = 0xBF58476D1CE4E5B9
MIX2   = 0x94D049BB133111EB
MASK64 = 0xFFFFFFFFFFFFFFFF

MCP Server

The Gay MCP server provides these tools:

ToolDescription
color_atGet color at specific index
paletteGenerate N-color palette
golden_threadGolden angle spiral
reafferenceSelf-recognition loop
loopy_strangeGenerator ≡ Observer

Commands

# Start MCP server
julia --project=@gay -e "using Gay; Gay.serve_mcp()"

# Generate palette
just gay-palette seed=1069 n=12

# Test determinism
just gay-test

API (Ruby)

require 'splitmix_ternary'

# Create generator
gen = SplitMixTernary.new(1069)

# Get color at index
color = gen.color_at(42)
# => { L: 45.2, C: 67.8, H: 234.5, trit: -1, index: 42 }

# Generate trits
gen.next_trit  # => -1, 0, or +1

# Split for parallelism
child = gen.split(7)  # Independent child generator

API (Julia)

using Gay

# Set seed
Gay.gay_seed(1069)

# Get color
color = Gay.color_at(42)

# Generate palette
palette = Gay.palette(12)

# Golden thread
colors = Gay.golden_thread(steps=10)

Tripartite Streams

Three independent streams with GF(3) = 0:

streams = SplitMixTernary::TripartiteStreams.new(seed)

triplet = streams.next_triplet
# => { minus: -1, ergodic: 0, plus: 1, gf3_sum: 0, conserved: true }

Trit Mapping

Hue 0-60°, 300-360° → +1 (PLUS, warm)
Hue 60-180°         →  0 (ERGODIC, neutral)
Hue 180-300°        → -1 (MINUS, cold)

Out-of-Order Proof

proof = SplitMixTernary.prove_out_of_order(seed)
# => { 
#      ordered_equals_reversed: true,
#      ordered_equals_shuffled: true,
#      proof: "QED: Math is doable out of order"
#    }

Integration with Unworld

Colors are derived, not temporal:

# Seed chaining
next_seed = Unworld.chain_seed(current_seed, color[:trit])

# Derive color
color = Unworld.derive_color(seed, index)

Example Output

╔═══════════════════════════════════════════════════════════════════╗
║  GAY.JL: Deterministic Color Generation                          ║
╚═══════════════════════════════════════════════════════════════════╝

Seed: 0x42D

─── Palette (12 colors) ───
  1: #D8267F (trit=+1)
  2: #2CD826 (trit=0)
  3: #4FD826 (trit=0)
  ...

─── Out-of-Order Proof ───
  Indices: [1, 5, 10, 20, 50]
  Ordered = Reversed: true
  Ordered = Shuffled: true
  QED: Math is doable out of order

Skill Name: gay-mcp Type: Deterministic Color Generation Trit: +1 (PLUS) GF(3): Conserved via tripartite streams SPI: Guaranteed (same seed → same output)

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View