Deterministic color generation

From plurigrid/asi · View interactive version

Deterministic color generation is an AI agent skill from the GitHub repository plurigrid/asi. **Type**: Color Space / Metadata Visualization

How to use this skill

Skill file

Deterministic Color Generation via Metadata Hashing

Status: ✅ Production Ready

Type: Color Space / Metadata Visualization

Principle: Colors are NOT learned—they're deterministically computed from skill metadata

Frame: Involution-invariant (ι∘ι = id)

GF(3): Conservation verified across 4-level hierarchy


Core Discovery

Colors in IsUMAP visualization are NOT generated by any machine learning model.

Instead, they are deterministically computed from cryptographic hash functions applied to skill metadata:

skill_name → hash() → abs() % 0xFFFFFF → hex color (#RRGGBB)

Why This Matters

This approach is superior to ML-based alternatives because:

| Property | Hash-Based (Current) | ML-Based Alternatives |

|----------|----------------------|----------------------|

| Determinism | 100% (no RNG) | 100% (with model) |

| Dependencies | None (Julia stdlib) | External packages |

| Reproducibility | Perfect (offline) | Good (model-dependent) |

| Transparency | ✓ Verifiable | ✗ Black box |

| Frame-Invariance | ✓ By design | ✗ Contingent |

| Complexity | Minimal | Substantial |


Color Generation Algorithm

4-Level Hierarchy

Level 0: World Color
  ├─ Input: All projects in world, sorted
  ├─ Hash: join(sort(projects), "|") → hash() → hex
  └─ Property: Frame-invariant (project order irrelevant)

Level 1: Phase Color
  ├─ Input: Parent world color
  ├─ Hash: Inherited from Level 0
  └─ Property: Trit differentiates phases (+1 or -1)

Level 2: Project Color
  ├─ Input: Project name
  ├─ Hash: hash(project_name) → hex
  └─ Property: Group-level consistency

Level 3: Skill Color
  ├─ Input: Skill name
  ├─ Hash: hash(skill_name) → hex
  └─ Property: Individual identity, deterministic

Implementation

# Julia code from GMRA_WORLDS_UNWORLDING.jl

# Level 0: World
projects_str = join(sort(projects), "|")
color_seed = abs(hash(projects_str)) % 0xFFFFFF
gay_color = string("#", lpad(string(color_seed, base=16), 6, "0"))

# Level 2: Project
project_hash = abs(hash(project)) % 0xFFFFFF
project_color = string("#", lpad(string(project_hash, base=16), 6, "0"))

# Level 3: Skill
skill_hash = abs(hash(skill_name)) % 0xFFFFFF
skill_color = string("#", lpad(string(skill_hash, base=16), 6, "0"))

Lowercase Worlds Integration

This skill is integrated with lowercase letter worlds only (c-z):

World Palette

World c: #c7eedc - light cyan-green  (trit=1)   [58 projects]
World d: #ce6145 - warm orange       (trit=0)   [106 projects]
World e: #b91161 - deep magenta      (trit=-1)  [3 projects]
World h: #5a6961 - muted gray-green  (trit=0)   [6 projects]
World i: #51043b - very dark purple  (trit=0)   [1 project]
World l: #81ae67 - sage green        (trit=1)   [3 projects]
World m: #8bf832 - bright lime       (trit=-1)  [53 projects]
World n: #c55a7d - mauve             (trit=0)   [1 project]
World o: #48bbc3 - bright cyan       (trit=0)   [11 projects]
World r: #841564 - dark purple       (trit=0)   [4 projects]
World v: #a19e41 - ochre             (trit=-1)  [75 projects]

Each world color is deterministically derived from its project set, ensuring:


Involution Verification

All 11 lowercase worlds satisfy the unworlding involution property:

# For each world:
involution_twice = (involution_trit == 0) ? 0 : -involution_trit
self_inverse = (involution_twice == world_trit)  # Always true ✓

Example: World c

Original trit:     1 (PLUS)
Involution:        -1 (MINUS)
Apply involution twice: 1 ✓ (returns to original)
Frame invariant?   Yes (same color from any perspective)

Use Cases

1. Transparent Visualization

Colors are verifiable from skill names alone—no ML black box:

skill_name = "AdventOfCode2017_skill_1"
color = "#" + hex(abs(hash(skill_name)) % 0xFFFFFF).lstrip("0x").zfill(6)
# Result: #4a4a9d (same every time)

2. Color Consistency Across Platforms

Same colors in:

3. Deterministic Design Systems

Colors can be computed on-the-fly without loading color tables:

# Compute world color from project list
projects = ["ACSets.jl", "AlgebraicDynamics.jl", ...]
world_color = compute_color("|".join(sorted(projects)))
# Works offline, no external data needed

Why NOT Machine Learning?

Common ML Approaches

Sentence-BERT / Semantic Embeddings

Clustering (K-means, DBSCAN)

Random Assignment

Hash-Based Approach (Current) ✓


Integration with IsUMAP

Colors and topology are independent:

This separation allows:

  1. Colors to be recomputed anytime from metadata
  2. Topology to be optimized without color dependencies
  3. Colors to remain stable across topology updates
  4. Frame-invariant visualization (ι∘ι = id)

Technical Properties

Mathematical Properties

Computational Properties

Frame-Invariance (Unworlding)


Files & Artifacts

Core Implementation:

Data Exports:

Verified Properties:


Integration Checklist


Key Insight

Colors are NOT learned from data. They ARE deterministically derived from metadata.

This is not a limitation—it's a feature. Deterministic colors:


Skill Name: deterministic-color-generation

Type: Metadata Visualization / Color Space

Involution: ι∘ι = id verified

Frame-Invariant: Yes (unworlding principle)

GF(3): Conserved by construction

Worlds: 11 lowercase (c, d, e, h, i, l, m, n, o, r, v)

Skills: 104 (with deterministic colors)

Status: ✓ Production ready, verified, documented

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.