Class DynamicPalette
- java.lang.Object
-
- org.pushingpixels.ephemeral.chroma.dynamiccolor.DynamicPalette
-
- All Implemented Interfaces:
TokenPalette
public class DynamicPalette extends java.lang.Object implements TokenPalette
Provides important settings for creating colors dynamically, and a tonal palette. Requires: 1. A color. (source color) 2. Whether or not its dark mode. 3. Contrast level. (-1 to 1, currently contrast ratio 3.0 and 7.0)
-
-
Field Summary
Fields Modifier and Type Field Description ContainerConfiguration
containerConfiguration
TonalPalette
palette
double
sourceColorTone
-
Constructor Summary
Constructors Constructor Description DynamicPalette(Hct sourceColorHct, ContainerConfiguration containerConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAccentOnContainer()
int
getArgb(DynamicPaletteColor dynamicPaletteColor)
int
getComplementaryContainerOutline()
int
getComplementaryOnContainer()
int
getContainerOutline()
int
getContainerOutlineVariant()
int
getContainerSurface()
int
getContainerSurfaceBright()
int
getContainerSurfaceDim()
int
getContainerSurfaceHigh()
int
getContainerSurfaceHighest()
int
getContainerSurfaceLow()
int
getContainerSurfaceLowest()
Hct
getHct(DynamicPaletteColor dynamicPaletteColor)
int
getInverseContainerOutline()
int
getInverseContainerSurface()
int
getInverseOnContainer()
int
getOnContainer()
int
getOnContainerVariant()
-
-
-
Field Detail
-
containerConfiguration
public final ContainerConfiguration containerConfiguration
-
palette
public final TonalPalette palette
-
sourceColorTone
public final double sourceColorTone
-
-
Constructor Detail
-
DynamicPalette
public DynamicPalette(Hct sourceColorHct, ContainerConfiguration containerConfiguration)
-
-
Method Detail
-
getHct
public Hct getHct(DynamicPaletteColor dynamicPaletteColor)
-
getArgb
public int getArgb(DynamicPaletteColor dynamicPaletteColor)
-
getContainerSurfaceLowest
public int getContainerSurfaceLowest()
- Specified by:
getContainerSurfaceLowest
in interfaceTokenPalette
-
getContainerSurfaceLow
public int getContainerSurfaceLow()
- Specified by:
getContainerSurfaceLow
in interfaceTokenPalette
-
getContainerSurface
public int getContainerSurface()
- Specified by:
getContainerSurface
in interfaceTokenPalette
-
getContainerSurfaceHigh
public int getContainerSurfaceHigh()
- Specified by:
getContainerSurfaceHigh
in interfaceTokenPalette
-
getContainerSurfaceHighest
public int getContainerSurfaceHighest()
- Specified by:
getContainerSurfaceHighest
in interfaceTokenPalette
-
getContainerSurfaceDim
public int getContainerSurfaceDim()
- Specified by:
getContainerSurfaceDim
in interfaceTokenPalette
-
getContainerSurfaceBright
public int getContainerSurfaceBright()
- Specified by:
getContainerSurfaceBright
in interfaceTokenPalette
-
getOnContainer
public int getOnContainer()
- Specified by:
getOnContainer
in interfaceTokenPalette
-
getOnContainerVariant
public int getOnContainerVariant()
- Specified by:
getOnContainerVariant
in interfaceTokenPalette
-
getContainerOutline
public int getContainerOutline()
- Specified by:
getContainerOutline
in interfaceTokenPalette
-
getContainerOutlineVariant
public int getContainerOutlineVariant()
- Specified by:
getContainerOutlineVariant
in interfaceTokenPalette
-
getInverseContainerSurface
public int getInverseContainerSurface()
- Specified by:
getInverseContainerSurface
in interfaceTokenPalette
-
getInverseOnContainer
public int getInverseOnContainer()
- Specified by:
getInverseOnContainer
in interfaceTokenPalette
-
getInverseContainerOutline
public int getInverseContainerOutline()
- Specified by:
getInverseContainerOutline
in interfaceTokenPalette
-
getComplementaryContainerOutline
public int getComplementaryContainerOutline()
- Specified by:
getComplementaryContainerOutline
in interfaceTokenPalette
-
getComplementaryOnContainer
public int getComplementaryOnContainer()
- Specified by:
getComplementaryOnContainer
in interfaceTokenPalette
-
getAccentOnContainer
public int getAccentOnContainer()
- Specified by:
getAccentOnContainer
in interfaceTokenPalette
-
-