MILKY_WAY_NIGHT_RAMP定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The package's ramp for a night sky: clear where there is no Milky Way, a faint blue glow, a grey-white band and a warm core, with the opacity rising with the brightness so that the texture can be laid over a dark sky as it is. Made for this package (no photograph's colours were read).
インポート
import { MILKY_WAY_NIGHT_RAMP } from "@johnmorrisdotca/hoshi-stars/milky-way";
定義
const MILKY_WAY_NIGHT_RAMP: readonly MilkyWayRampStop[] = Object.freeze(([
[0, 0, 0, 0, 0],
[0.08, 106, 128, 200, 0.1],
[0.2, 122, 144, 210, 0.24],
[0.4, 166, 182, 230, 0.4],
[0.65, 232, 228, 232, 0.58],
[1, 255, 243, 216, 0.88],
] as const).map(([level, red, green, blue, alpha]) => Object.freeze({ level, red, green, blue, alpha })))
例
import { MILKY_WAY_NIGHT_RAMP } from "@johnmorrisdotca/hoshi-stars/milky-way";
console.log(MILKY_WAY_NIGHT_RAMP.length, MILKY_WAY_NIGHT_RAMP[0]!.alpha); // 6 06 0出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。