This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

ColorPaletteGenerator Pennington.MonorailCss

Generates Tailwind-style 11-step OKLCH palettes from a seed hue and chroma, plus the coordinating accent and neutral base palettes that go with them.

Methods

ApplyAlgorithmicColorScheme

#
public static Theme ApplyAlgorithmicColorScheme(Theme theme, double hue, double chroma, CoordinatingScheme scheme)

Wires algorithmic palettes (base + primary + accents) onto the theme. Primary is a foreground palette at hue/chroma; base is a desaturated neutral palette at the same hue; accents are foreground palettes at hues picked by scheme. Schemes with multiple accents register the first as accent and additional ones as accent-2, accent-3, ….

Parameters

theme Theme
hue double
chroma double
scheme CoordinatingScheme

Returns

Theme

GenerateForeground

#
public static ImmutableDictionary<string, string> GenerateForeground(double hue, double chroma)

Generates a vibrant foreground 11-step OKLCH palette. The 500 stop lands on chroma; other stops scale relative to it via the foreground chroma curve.

Parameters

hue double
chroma double

Returns

ImmutableDictionary<string, string>

GenerateNeutral

#
public static ImmutableDictionary<string, string> GenerateNeutral(double hue, double chroma)

Generates a near-gray neutral 11-step OKLCH palette. Chroma scales by intensity (chroma / curve at 500) and the dark tail blends between tapered and held-high shapes via DarkChromaRetention.

Parameters

hue double
chroma double

Returns

ImmutableDictionary<string, string>

Pennington.MonorailCss.ColorPaletteGenerator

namespace Pennington.MonorailCss;

/// Generates Tailwind-style 11-step OKLCH palettes from a seed hue and chroma, plus the coordinating accent and neutral base palettes that go with them.
public class ColorPaletteGenerator
{
    /// Wires algorithmic palettes (base + primary + accents) onto the theme. Primary is a foreground palette at hue/chroma; base is a desaturated neutral palette at the same hue; accents are foreground palettes at hues picked by scheme. Schemes with multiple accents register the first as accent and additional ones as accent-2, accent-3, ….
    
public static Theme ApplyAlgorithmicColorScheme(Theme theme, double hue, double chroma, CoordinatingScheme scheme)
; /// Generates a vibrant foreground 11-step OKLCH palette. The 500 stop lands on chroma; other stops scale relative to it via the foreground chroma curve.
public static ImmutableDictionary<string, string> GenerateForeground(double hue, double chroma)
; /// Generates a near-gray neutral 11-step OKLCH palette. Chroma scales by intensity (chroma / curve at 500) and the dark tail blends between tapered and held-high shapes via DarkChromaRetention.
public static ImmutableDictionary<string, string> GenerateNeutral(double hue, double chroma)
; }