SugorokuColours型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
THE COLOURS OF A BOARD. Every colour the drawing uses is one of these, set as
a custom property on the drawing (--sg-felt and so on), so a page's own
style may change any of them, and drawSugoroku takes any of them as an
option. Where a colour is left out the drawing uses the theme's: light by
default, dark when the device is (see SUGOROKU_STYLE).
インポート
import type { SugorokuColours } from "@johnmorrisdotca/sugoroku/draw";
定義
type SugorokuColours = {
frame: string;
felt: string;
pointA: string;
pointB: string;
bar: string;
tray: string;
white: string;
whiteEdge: string;
black: string;
blackEdge: string;
number: string;
selected: string;
target: string;
die: string;
pip: string;
cube: string;
cubeInk: string;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
frame | string | The frame the board is set in. |
felt | string | The playing surface. |
pointA | string | The points, alternately. |
pointB | string | |
bar | string | The bar, and the trays' floor. |
tray | string | |
white | string | The checkers: the face and the rim of each side's. |
whiteEdge | string | |
black | string | |
blackEdge | string | |
number | string | The numbers on the points, and a count on a tall stack. |
selected | string | What marks the checker picked up, and the places it may go. |
target | string | |
die | string | The dice and the cube. |
pip | string | |
cube | string | |
cubeInk | string |
例
import type { SugorokuColours } from "@johnmorrisdotca/sugoroku/draw";
import { SUGOROKU_COLOUR_NAMES } from "@johnmorrisdotca/sugoroku/draw";
const value: SugorokuColours = Object.fromEntries(SUGOROKU_COLOUR_NAMES.map(name=>[name,"#ffffff"])) as SugorokuColours;
console.log(value);{
frame: '#ffffff',
felt: '#ffffff',
pointA: '#ffffff',
pointB: '#ffffff',
bar: '#ffffff',
tray: '#ffffff',
white: '#ffffff',
whiteEdge: '#ffffff',
black: '#ffffff',
blackEdge: '#ffffff',
number: '#ffffff',
selected: '#ffffff',
target: '#ffffff',
die: '#ffffff',
pip: '#ffffff',
cube: '#ffffff',
cubeInk: '#ffffff'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。