AlgorithmicColorScheme
Pennington.MonorailCss
A color scheme that generates palettes algorithmically from a seed hue and chroma. The scheme synthesises primary, base, and one or more accent palettes; see ApplyAlgorithmicColorScheme for the underlying mechanics.
Properties
AdditionalMappingsDictionary<string, ColorName>- Gets or sets additional color mappings beyond the core slots. Key is the target slot name (e.g., "info", "warning"), value is the source color.
Chromadouble- Gets or sets the seed chroma for the primary palette. Typical range is 0.05 (muted) to 0.30 (vivid); the 500 stop of the generated primary lands on this value.
PrimaryHuedouble- requiredGets or sets the primary hue value in degrees (0-360).
SchemeCoordinatingScheme- Gets or sets the coordinating scheme that picks accent hues relative to
PrimaryHue. Defaults toComplementary.
Methods
ApplyToTheme
#public Theme ApplyToTheme(Theme theme)
Applies the color scheme to the given theme.
Parameters
themeTheme- The theme to apply colors to
Returns
ThemePennington.MonorailCss.AlgorithmicColorScheme
namespace Pennington.MonorailCss;
/// A color scheme that generates palettes algorithmically from a seed hue and chroma. The scheme synthesises primary, base, and one or more accent palettes; see ApplyAlgorithmicColorScheme for the underlying mechanics.
public class AlgorithmicColorScheme
{
/// Gets or sets additional color mappings beyond the core slots. Key is the target slot name (e.g., "info", "warning"), value is the source color.
public Dictionary<string, ColorName> AdditionalMappings { get; set; }
/// Applies the color scheme to the given theme.
public Theme ApplyToTheme(Theme theme)
;
/// Gets or sets the seed chroma for the primary palette. Typical range is 0.05 (muted) to 0.30 (vivid); the 500 stop of the generated primary lands on this value.
public double Chroma { get; set; }
/// Gets or sets the primary hue value in degrees (0-360).
public double PrimaryHue { get; set; }
/// Gets or sets the coordinating scheme that picks accent hues relative to PrimaryHue. Defaults to Complementary.
public CoordinatingScheme Scheme { get; set; }
}