Theme型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The colours and sizes a game draws with, read from the page's custom properties (--kk-*) so that it follows light, dark and the family's cloths.
インポート
import type { Theme } from "@johnmorrisdotca/karakuri/play";
ほかのエクスポート元: @johnmorrisdotca/karakuri
定義
interface Theme {
board: string;
deep: string;
ink: string;
muted: string;
accent: string;
good: string;
bad: string;
gold: string;
water: string;
lava: string;
stone: string;
paper: string;
dark: boolean;
font: string;
lang: "en" | "ja";
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
board | string | The play area's floor. |
deep | string | The darker ground, for grooves and shadows. |
ink | string | |
muted | string | |
accent | string | The line the player draws, and highlights. |
good | string | |
bad | string | |
gold | string | |
water | string | |
lava | string | |
stone | string | |
paper | string | A light colour that reads on |
dark | boolean | |
font | string | |
lang | "en" | "ja" | The language words drawn on the canvas are in. |
例
import type { Theme } from "@johnmorrisdotca/karakuri/play";
import { defaultTheme } from "@johnmorrisdotca/karakuri/play";
const value: Theme = defaultTheme();
console.log(value);{
board: '#f6f1e6',
deep: '#e4dcc9',
ink: '#2b2a28',
muted: '#8a8473',
accent: '#2f6f55',
good: '#2f8f5b',
bad: '#c2453a',
gold: '#e0a82e',
water: '#3b8fd9',
lava: '#e8561f',
stone: '#8d8a82',
paper: '#fffdf7',
dark: false,
font: 'system-ui, sans-serif',
lang: 'en'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。