Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

Reference · Rolls and exact odds

CustomFacetype

One face of a custom die: what it says, what it is worth in a total if it is worth anything, and a colour for it. The words are text and only ever shown as text.

Import it

import type { CustomFace } from "@johnmorrisdotca/korokoro";

Definition

type CustomFace = {
    label: string;
    value?: number;
    colour?: string;
};

Members

NameTypeDescription
labelstring

What the face says: 1 to MAX_LABEL characters.

value (optional)number | undefined

What it adds to a total. Left out of a face that is only words, which adds nothing.

colour (optional)string | undefined

A colour for the face, as #rgb or #rrggbb. Left out for the tray's own.

Examples

import type { CustomFace } from "@johnmorrisdotca/korokoro";
const value: CustomFace = { label: "Hit", value: 1, colour: "#2f5d4a" };
console.log(value.label);
Hit

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/korokoro 1.16.0.