一键导入
basementuniverse-color
Use this skill when working with @basementuniverse/color for parsing, converting, formatting, manipulating, and generating RGBA/HSLA colors.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this skill when working with @basementuniverse/color for parsing, converting, formatting, manipulating, and generating RGBA/HSLA colors.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when implementing or working with chunk-based viewport rendering systems in 2D games using @basementuniverse/view-port. Handles visible chunk computation, lazy chunk generation, chunk lifecycle management (update/draw), and FIFO cache eviction. Ideal for tile-based or grid-based world rendering where only visible + buffered chunks need processing.
Use this skill when working with 2D tile-based game rendering, implementing chunked tile map systems, procedural tile generation, tile-based collision detection, or optimizing tile rendering performance with the @basementuniverse/tile-map library.
Use when working with sprite sheets, texture atlases, or extracting rectangular regions from images into separate canvases. Handles grid-based and pixel-based extraction, repeating regions for animations, and integrates with @basementuniverse/content-manager.
Use this skill when implementing timers, countdowns, or time-tracking features in browser-based games using the @basementuniverse/stopwatch library. Covers game loop integration, timer configuration, and time-based events.
Use this skill when working with @basementuniverse/sprite - a 2D sprite component for games with animations, directions, attachment points, and debug visualization. Invoke when creating or modifying game sprites, implementing sprite animations, setting up directional sprites (e.g., walk-left, walk-right), working with attachment points for composite sprites, or integrating with Content Manager for asset loading.
Use this skill when implementing or working with stack-based scene management in TypeScript/JavaScript games. Covers scene transitions, scene lifecycle, rendering order, and scene stack operations using @basementuniverse/scene-manager.
| name | basementuniverse-color |
| description | Use this skill when working with @basementuniverse/color for parsing, converting, formatting, manipulating, and generating RGBA/HSLA colors. |
Use this skill when working with @basementuniverse/color.
rgb(a), hsl(a), or hex strings.The package currently exports:
RGBAColor, HSLAColor, random option types.ColorUtils object containing all runtime helpers.Preferred usage pattern:
import { ColorUtils, type RGBAColor, type HSLAColor } from '@basementuniverse/color';
const c1: RGBAColor = ColorUtils.stringToRGBA('#ff0000');
const c2: HSLAColor = ColorUtils.rgbaToHSLA(c1);
const css = ColorUtils.hslaToString(c2);
Important:
ColorUtils.isRGBAColor, isHSLAColor) exist internally but are not part of the exported runtime API.ColorUtils.stringToRGBA.rng function to random utilities.stringToRGBA falls back to opaque black, so validate upstream if this default could hide input errors.const parsed = ColorUtils.stringToRGBA(userInput);
const hex = ColorUtils.rgbaToString(parsed, { mode: 'hex' });
const next = ColorUtils.fadeOut({ r: 255, g: 120, b: 40, a: 1 }, 0.25);
const css = ColorUtils.rgbaToString(next);
const rngValues = [0.1, 0.5, 0.9];
let i = 0;
const rng = () => rngValues[i++ % rngValues.length];
const sampled = ColorUtils.randomGradient(
[{ r: 255, g: 0, b: 0 }, { r: 0, g: 0, b: 255 }],
{ position: { min: 0, max: 1 }, rng }
);