Class BimodalTonalPalette
java.lang.Object
org.pushingpixels.ephemeral.chroma.palettes.BimodalTonalPalette
- All Implemented Interfaces:
BaseTonalPalette
A convenience class for retrieving colors that are sourced from an interpolation
between two HCT seeds.
BimodalTonalPalette is intended for use in a single thread due to its stateful caching.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TonalPaletteprivate final TonalPaletteprivate final BimodalTonalPalette.TransitionRange -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBimodalTonalPalette(TonalPalette palette1, TonalPalette palette2, BimodalTonalPalette.TransitionRange transitionRange) -
Method Summary
Modifier and TypeMethodDescriptionstatic BimodalTonalPalettefrom(Hct hct1, Hct hct2, BimodalTonalPalette.TransitionRange transitionRange) getHct(double tone) Given a tone, use hue and chroma of palette to create a color, and return it as HCT.inttone(int tone) Create an ARGB color from this palette and the provided HCT tone.
-
Field Details
-
palette1
-
palette2
-
transitionRange
-
cache
-
-
Constructor Details
-
BimodalTonalPalette
private BimodalTonalPalette(TonalPalette palette1, TonalPalette palette2, BimodalTonalPalette.TransitionRange transitionRange)
-
-
Method Details
-
from
public static BimodalTonalPalette from(Hct hct1, Hct hct2, BimodalTonalPalette.TransitionRange transitionRange) -
tone
public int tone(int tone) Description copied from interface:BaseTonalPaletteCreate an ARGB color from this palette and the provided HCT tone.- Specified by:
tonein interfaceBaseTonalPalette- Parameters:
tone- HCT tone, measured from 0 to 100.- Returns:
- ARGB representation of a color with that tone.
-
getHct
Given a tone, use hue and chroma of palette to create a color, and return it as HCT.- Specified by:
getHctin interfaceBaseTonalPalette
-