Skip to content

Reference

tilttek/dice-skins
TypeRole
DiceSkinsThe members' choices, the dice they own, and the appearance of each die
DieAppearanceThe appearance of a die: its name, its look, its source; as CSS custom properties, data attributes or plain values
AppearanceSourceOwned, ChosenForSides, ChosenForAll or Default
AccessibilityStandard or HighContrast
SkinA skin a site offers: key, label, look, and looks by number of sides; its numbers at 4.5:1 at least
SkinLookThe colour of the faces and of the ink, the material and the texture; its contrast
SkinDefinitionsReads skins from plain values or JSON
BaseSkinsThe eight skins the library ships, and the high-contrast one
SkinChoiceThe skin a member chose, for one number of sides or for all their dice
OwnedDieA die of a set a member owns, and its look
ColorAn sRGB colour: its luminance, its contrast with another, the best ink on it
MaterialWhat a die seems to be made of, and the material a free text names
TextureReferenceThe key of a texture the renderer resolves
Contract\SkinCatalogThe skins the site offers
Contract\SkinChoiceStoreWhere the members' choices are kept
Contract\OwnedDiceThe dice a member owns
Store\FixedSkinCatalogThe skins given once, the base skins with the site's
Store\InMemorySkinChoiceStoreThe choices in memory, for tests and scripts
Store\NoOwnedDiceNobody owns any dice
Collections\ShelfOwnedDiceThe owned dice read from the shelf of tilttek/collections
DiceBundle\DiceSkinsAppearanceThe appearance given to the roller of tilttek/dice-bundle, through its DiceAppearance port

Exceptions

ExceptionThrown when
Exception\DiceSkinsExceptionThe interface of every exception of the library
Exception\InvalidSkinA colour, key, label, texture, number of sides or definition the library refuses, or a look whose numbers would stand out at less than 4.5:1
Exception\SkinRefusedA skin the catalog does not offer is chosen, or is the default — through the adapter of tilttek/dice-bundle too

Each message says what was expected, as A colour is written #rgb or #rrggbb; "red" is not.