mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Add other palette items and toggles
This commit is contained in:
@@ -14,7 +14,9 @@ export const PALETTE = {
|
||||
EYE: "eye",
|
||||
FACE: "face",
|
||||
HOOD: "hood",
|
||||
EYEBROW: "eyebrow",
|
||||
NOSE: "nose",
|
||||
CHEEK: "cheek",
|
||||
BELLY: "belly",
|
||||
UNDERBELLY: "underbelly",
|
||||
WING: "wing",
|
||||
@@ -39,7 +41,9 @@ export const SPRITE_SHEET_COLOR_MAP = {
|
||||
"#af8e75": PALETTE.FOOT,
|
||||
"#639bff": PALETTE.FACE,
|
||||
"#99e550": PALETTE.HOOD,
|
||||
"#ff5573": PALETTE.EYEBROW,
|
||||
"#d95763": PALETTE.NOSE,
|
||||
"#ff67a9": PALETTE.CHEEK,
|
||||
"#f8b143": PALETTE.BELLY,
|
||||
"#ec8637": PALETTE.UNDERBELLY,
|
||||
"#578ae6": PALETTE.WING,
|
||||
@@ -71,7 +75,9 @@ export class BirdType {
|
||||
[PALETTE.HEART_SHINE]: "#ff6b6b",
|
||||
[PALETTE.FEATHER_SPINE]: "#373737",
|
||||
[PALETTE.HOOD]: colors.face,
|
||||
[PALETTE.EYEBROW]: colors.face,
|
||||
[PALETTE.NOSE]: colors.face,
|
||||
[PALETTE.CHEEK]: colors.face,
|
||||
};
|
||||
/** @type {Record<string, string>} */
|
||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||
@@ -81,8 +87,8 @@ export class BirdType {
|
||||
|
||||
/**
|
||||
* Load a sprite sheet image and convert it to a 2D array of palette color names
|
||||
* @param {string} src - URL or data URI of the sprite sheet image
|
||||
* @param {boolean} [templateColors] - Whether to map pixel colors to palette names
|
||||
* @param {string} src URL or data URI of the sprite sheet image
|
||||
* @param {boolean} [templateColors] Whether to map pixel colors to palette names
|
||||
* @returns {Promise<string[][]>}
|
||||
*/
|
||||
export function loadSpriteSheetPixels(src, templateColors = true) {
|
||||
|
||||
Reference in New Issue
Block a user