-
public class StreamDesign.ColorScale.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static StreamDesign.ColorScale.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final StreamDesign.ColorScaledefaultLight()Default brand scale for light themes. final StreamDesign.ColorScaledefaultDark()Default brand scale for dark themes. final StreamDesign.ColorScalefrom(Color brandColor)Generates a brand scale from a single brandColor. -
-
Method Detail
-
defaultLight
final StreamDesign.ColorScale defaultLight()
Default brand scale for light themes.
Maps brand stops 50..900 → blue 50..900 (natural order).
-
defaultDark
final StreamDesign.ColorScale defaultDark()
Default brand scale for dark themes.
Inverts the mapping: brand 50 → blue 900, brand 900 → blue 50, so that perceptual intensity is preserved on dark backgrounds.
-
from
final StreamDesign.ColorScale from(Color brandColor)
Generates a brand scale from a single brandColor.
The input is placed at s500 (the core brand stop). Lighter stops are interpolated toward white and darker stops toward black using Oklab perceptual color space.
This is an approximation intended for quick re-branding. For pixel-perfect results, provide an explicit ColorScale.
Use inverted to obtain the dark-theme counterpart:
val purple = ColorScale.from(brandColor = Color(0xFF6200EE)) val light = Colors.default(brand = purple) val dark = Colors.defaultDark(brand = purple.inverted())- Parameters:
brandColor- The core brand color (maps to s500).
-
-
-
-