Class PillPalette
A pill column marked Render.categorical() colours each distinct value from a fixed palette of
SIZE colours. The browser picks the slot with the hash documented on slot(String); this class is
the same function in Java, for parity tests and for server-side code that wants to know which slot a value gets
(for example to build a legend). The renderer does not call it at runtime.
SIZE is part of the colour contract: changing it recolours every categorical value.
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe number of palette slots (theme tokens--jc-pill-cat-1-*through--jc-pill-cat-10-*). -
Method Summary
-
Field Details
-
SIZE
The number of palette slots (theme tokens--jc-pill-cat-1-*through--jc-pill-cat-10-*).- See Also:
-
-
Method Details
-
slot
Returns the palette slot for a value.FNV-1a, 32-bit, over the UTF-16 code units of the exact string (no case folding, no trimming), then
(hash mod SIZE) + 1with the hash treated as unsigned. Matching is case-sensitive:"Pet"and"PET"are different values with independent slots. Anull value hashes as the empty string.Reports only the hash slot, never a slot pinned with
Render.category(String,int).- Parameters:
value- The cell value as displayed. Can benull .- Returns:
- The slot, from 1 to
SIZEinclusive.
-