resolveBackground関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Reads the background option for a drawing width by height in the look theme, with prefix for the ids. Returns null when the option is true, false or left out
(a plain colour, or none). An unknown preset, a bad colour list or an image address that is not http(s), relative or data:image/… throws a RangeError.
インポート
import { resolveBackground } from "@johnmorrisdotca/taisen-brackets";
定義
function resolveBackground(option: unknown, theme: ThemeName, width: number, height: number, prefix: string): ResolvedBackground | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
option | unknown | The |
theme | ThemeName | The theme the drawing is in. |
width | number | The drawing's width. |
height | number | The drawing's height. |
prefix | string | The prefix of the drawing's ids. |
戻り値
ResolvedBackground | null
The background; null when the option asks for none.
例
import { resolveBackground } from "@johnmorrisdotca/taisen-brackets";
console.log(resolveBackground(false, "light", 400, 300, "tb"), resolveBackground("ice", "light", 400, 300, "tb") !== null);null true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。