@guilhermebkel/scenec 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -12
- package/dist/Adapters/FontAdapter.js +5 -1
- package/dist/Commands/BestCommand.d.ts +11 -0
- package/dist/Commands/BestCommand.js +73 -0
- package/dist/Commands/RenderCommand.d.ts +2 -0
- package/dist/Commands/RenderCommand.js +7 -0
- package/dist/Modules/BestModule.d.ts +41 -0
- package/dist/Modules/BestModule.js +159 -0
- package/dist/Modules/CompilationModule.d.ts +5 -0
- package/dist/Modules/CompilationModule.js +92 -19
- package/dist/Modules/CritiqueModule.d.ts +3 -0
- package/dist/Modules/CritiqueModule.js +60 -5
- package/dist/Protocols/AssetProtocol.d.ts +6 -1
- package/dist/Protocols/AssetProtocol.js +17 -1
- package/dist/Protocols/CommandProtocol.d.ts +2 -0
- package/dist/Protocols/CompilationProtocol.d.ts +27 -1
- package/dist/Protocols/CritiqueProtocol.d.ts +17 -1
- package/dist/Protocols/CritiqueProtocol.js +11 -1
- package/dist/Protocols/KitProtocol.d.ts +8 -2
- package/dist/Protocols/KitProtocol.js +8 -2
- package/dist/Protocols/PersonProtocol.d.ts +4 -0
- package/dist/Protocols/PersonProtocol.js +2 -0
- package/dist/Protocols/SceneProtocol.d.ts +204 -5
- package/dist/Protocols/SceneProtocol.js +60 -7
- package/dist/Resources/Assets/BaseAsset.d.ts +1 -0
- package/dist/Resources/Assets/BaseAsset.js +1 -0
- package/dist/Resources/Assets/BigPlantAsset.js +8 -1
- package/dist/Resources/Assets/BlackboardAsset.d.ts +11 -0
- package/dist/Resources/Assets/BlackboardAsset.js +20 -0
- package/dist/Resources/Assets/BushAsset.js +1 -1
- package/dist/Resources/Assets/ChairAsset.d.ts +5 -0
- package/dist/Resources/Assets/ChairAsset.js +23 -0
- package/dist/Resources/Assets/ChatBubbleAsset.d.ts +11 -0
- package/dist/Resources/Assets/ChatBubbleAsset.js +18 -0
- package/dist/Resources/Assets/CloudAsset.js +3 -1
- package/dist/Resources/Assets/ConfettiAsset.d.ts +10 -0
- package/dist/Resources/Assets/ConfettiAsset.js +18 -0
- package/dist/Resources/Assets/CursorAsset.d.ts +11 -0
- package/dist/Resources/Assets/CursorAsset.js +17 -0
- package/dist/Resources/Assets/DeskAsset.js +7 -2
- package/dist/Resources/Assets/FirstAidKitAsset.d.ts +10 -0
- package/dist/Resources/Assets/FirstAidKitAsset.js +19 -0
- package/dist/Resources/Assets/GlobeAsset.d.ts +10 -0
- package/dist/Resources/Assets/GlobeAsset.js +18 -0
- package/dist/Resources/Assets/HouseAsset.js +22 -6
- package/dist/Resources/Assets/LaptopAsset.js +5 -1
- package/dist/Resources/Assets/PlantAsset.js +1 -1
- package/dist/Resources/Assets/PodiumAsset.d.ts +11 -0
- package/dist/Resources/Assets/PodiumAsset.js +20 -0
- package/dist/Resources/Assets/RefrigeratorAsset.d.ts +11 -0
- package/dist/Resources/Assets/RefrigeratorAsset.js +21 -0
- package/dist/Resources/Assets/SinkAsset.d.ts +11 -0
- package/dist/Resources/Assets/SinkAsset.js +21 -0
- package/dist/Resources/Assets/SofaAsset.d.ts +5 -0
- package/dist/Resources/Assets/SofaAsset.js +30 -2
- package/dist/Resources/Assets/StarsAsset.d.ts +6 -0
- package/dist/Resources/Assets/StarsAsset.js +37 -24
- package/dist/Resources/Assets/StethoscopeAsset.d.ts +10 -0
- package/dist/Resources/Assets/StethoscopeAsset.js +18 -0
- package/dist/Resources/Assets/StoveAsset.d.ts +11 -0
- package/dist/Resources/Assets/StoveAsset.js +20 -0
- package/dist/Resources/Assets/ToggleAsset.d.ts +11 -0
- package/dist/Resources/Assets/ToggleAsset.js +21 -0
- package/dist/Resources/Assets/TreeAsset.d.ts +5 -0
- package/dist/Resources/Assets/TreeAsset.js +32 -7
- package/dist/Resources/Assets/WaterCoolerAsset.d.ts +11 -0
- package/dist/Resources/Assets/WaterCoolerAsset.js +20 -0
- package/dist/Resources/Assets/WhiteboardAsset.d.ts +10 -0
- package/dist/Resources/Assets/WhiteboardAsset.js +18 -0
- package/dist/Resources/Kits/BaseKit.d.ts +2 -1
- package/dist/Resources/Kits/BaseKit.js +1 -0
- package/dist/Resources/Kits/ClayKit.d.ts +9 -0
- package/dist/Resources/Kits/ClayKit.js +11 -0
- package/dist/Resources/Kits/DuotoneKit.d.ts +16 -0
- package/dist/Resources/Kits/DuotoneKit.js +18 -0
- package/dist/Resources/Kits/IsometricKit.d.ts +8 -0
- package/dist/Resources/Kits/IsometricKit.js +10 -0
- package/dist/Resources/Kits/OutlineKit.d.ts +3 -0
- package/dist/Resources/Kits/OutlineKit.js +1 -1
- package/dist/Resources/Kits/PaperKit.d.ts +2 -0
- package/dist/Resources/Kits/PaperKit.js +1 -0
- package/dist/Resources/Kits/PosterKit.d.ts +14 -0
- package/dist/Resources/Kits/PosterKit.js +16 -0
- package/dist/Resources/Kits/SketchKit.d.ts +2 -1
- package/dist/Resources/Kits/SketchKit.js +1 -0
- package/dist/Services/AssetService.js +29 -1
- package/dist/Services/BackgroundService.d.ts +10 -2
- package/dist/Services/BackgroundService.js +52 -11
- package/dist/Services/CatalogService.d.ts +1 -0
- package/dist/Services/CatalogService.js +8 -3
- package/dist/Services/ColorCritiqueService.d.ts +42 -0
- package/dist/Services/ColorCritiqueService.js +232 -0
- package/dist/Services/ContextService.js +9 -5
- package/dist/Services/DescriptionService.d.ts +2 -1
- package/dist/Services/DescriptionService.js +8 -2
- package/dist/Services/DetailService.d.ts +7 -0
- package/dist/Services/DetailService.js +18 -0
- package/dist/Services/FocusCritiqueService.d.ts +23 -0
- package/dist/Services/FocusCritiqueService.js +166 -0
- package/dist/Services/FramingService.d.ts +31 -0
- package/dist/Services/FramingService.js +108 -0
- package/dist/Services/GazeService.js +3 -1
- package/dist/Services/GroundDetailService.d.ts +50 -0
- package/dist/Services/GroundDetailService.js +115 -0
- package/dist/Services/KitService.d.ts +11 -2
- package/dist/Services/KitService.js +45 -10
- package/dist/Services/LightingService.d.ts +15 -0
- package/dist/Services/LightingService.js +124 -6
- package/dist/Services/PaletteService.d.ts +108 -0
- package/dist/Services/PaletteService.js +282 -0
- package/dist/Services/PieceService.d.ts +4 -0
- package/dist/Services/PieceService.js +28 -7
- package/dist/Services/PlacementService.js +7 -1
- package/dist/Services/PlaneBackgroundService.d.ts +4 -0
- package/dist/Services/PlaneBackgroundService.js +42 -3
- package/dist/Services/PlaneProjectionService.d.ts +4 -0
- package/dist/Services/PlaneProjectionService.js +33 -4
- package/dist/Services/RasterService.js +20 -3
- package/dist/Services/RidgeService.d.ts +31 -0
- package/dist/Services/RidgeService.js +85 -0
- package/dist/Services/ScaleCritiqueService.d.ts +11 -0
- package/dist/Services/ScaleCritiqueService.js +57 -0
- package/dist/Services/SkyDetailService.d.ts +39 -0
- package/dist/Services/SkyDetailService.js +95 -0
- package/dist/Services/{ContactCritiqueService.d.ts → TangentCritiqueService.d.ts} +10 -6
- package/dist/Services/TangentCritiqueService.js +136 -0
- package/dist/Services/TextService.d.ts +43 -3
- package/dist/Services/TextService.js +288 -32
- package/dist/Services/ThumbnailCritiqueService.d.ts +30 -0
- package/dist/Services/ThumbnailCritiqueService.js +130 -0
- package/dist/Utils/ColorUtil.d.ts +14 -0
- package/dist/Utils/ColorUtil.js +68 -5
- package/dist/Utils/DetailUtil.d.ts +7 -0
- package/dist/Utils/DetailUtil.js +15 -0
- package/dist/Utils/FontMetricsUtil.d.ts +7 -0
- package/dist/Utils/FontMetricsUtil.js +694 -0
- package/dist/Utils/OklabUtil.d.ts +18 -0
- package/dist/Utils/OklabUtil.js +89 -0
- package/dist/Utils/PersonArmUtil.d.ts +13 -1
- package/dist/Utils/PersonArmUtil.js +53 -5
- package/dist/Utils/PersonHeadUtil.js +3 -1
- package/dist/Utils/PersonOutfitUtil.d.ts +16 -0
- package/dist/Utils/PersonOutfitUtil.js +89 -13
- package/dist/Utils/PersonUtil.d.ts +2 -0
- package/dist/Utils/PersonUtil.js +14 -4
- package/dist/Utils/SanitizeUtil.js +1 -0
- package/dist/Utils/ShapeUtil.d.ts +9 -0
- package/dist/Utils/ShapeUtil.js +26 -0
- package/dist/Utils/TypesettingUtil.d.ts +17 -0
- package/dist/Utils/TypesettingUtil.js +92 -0
- package/dist/cli.js +32 -3
- package/dist/render.d.ts +3 -1
- package/dist/render.js +5 -0
- package/fonts/DMSerifDisplay-Regular.ttf +0 -0
- package/fonts/OFL.txt +2 -0
- package/fonts/PatrickHand-Regular.ttf +0 -0
- package/package.json +1 -1
- package/skills/draw-scene/SKILL.md +2 -1
- package/skills/draw-scene/recipes/carousel.yaml +1 -1
- package/skills/draw-scene/recipes/conference-keynote.yaml +43 -0
- package/skills/draw-scene/recipes/product-feature.yaml +41 -0
- package/skills/draw-scene/recipes/product-illustration.yaml +2 -1
- package/skills/draw-scene/references/catalog.md +19 -1
- package/skills/draw-scene/references/dsl.md +24 -6
- package/dist/Services/ContactCritiqueService.js +0 -101
|
@@ -6,5 +6,10 @@ export declare class TreeAsset extends BaseAsset {
|
|
|
6
6
|
readonly width = 115;
|
|
7
7
|
readonly height = 205;
|
|
8
8
|
readonly tags: string[];
|
|
9
|
+
readonly variants: string[];
|
|
10
|
+
private static readonly VARIANT_TO_DRAWER;
|
|
9
11
|
draw(params: AssetParams, theme: Theme): string;
|
|
12
|
+
private drawDefault;
|
|
13
|
+
private drawTall;
|
|
14
|
+
private drawWide;
|
|
10
15
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ColorUtil } from "../../Utils/ColorUtil.js";
|
|
2
2
|
import { BaseAsset } from "./BaseAsset.js";
|
|
3
|
+
import { DetailUtil } from "../../Utils/DetailUtil.js";
|
|
4
|
+
import { IdUtil } from "../../Utils/IdUtil.js";
|
|
3
5
|
import { ShapeUtil } from "../../Utils/ShapeUtil.js";
|
|
4
6
|
class TreeAsset extends BaseAsset {
|
|
5
7
|
id = "tree";
|
|
@@ -7,15 +9,38 @@ class TreeAsset extends BaseAsset {
|
|
|
7
9
|
width = 115;
|
|
8
10
|
height = 205;
|
|
9
11
|
tags = ["\xE1rvore", "arvore", "tree_round", "oak"];
|
|
12
|
+
variants = ["2", "tall", "3", "wide"];
|
|
13
|
+
static VARIANT_TO_DRAWER = {
|
|
14
|
+
2: (asset, params, theme) => asset.drawTall(params, theme),
|
|
15
|
+
tall: (asset, params, theme) => asset.drawTall(params, theme),
|
|
16
|
+
3: (asset, params, theme) => asset.drawWide(params, theme),
|
|
17
|
+
wide: (asset, params, theme) => asset.drawWide(params, theme)
|
|
18
|
+
};
|
|
10
19
|
draw(params, theme) {
|
|
20
|
+
const variantKey = String(params.variant ?? "");
|
|
21
|
+
const drawer = IdUtil.lookup(TreeAsset.VARIANT_TO_DRAWER, variantKey);
|
|
22
|
+
return drawer ? drawer(this, params, theme) : this.drawDefault(params, theme);
|
|
23
|
+
}
|
|
24
|
+
drawDefault(params, theme) {
|
|
25
|
+
const [first, second, color] = theme.foliage;
|
|
26
|
+
const rank = DetailUtil.rankOf(params.detail);
|
|
27
|
+
const hasParts = rank >= 1;
|
|
28
|
+
const isHigh = rank >= 2;
|
|
29
|
+
const branches = hasParts ? `<path d="M0 -80 L-22 -110 M0 -95 L20 -120" stroke="${theme.trunk}" stroke-width="5" stroke-linecap="round"/>` : "";
|
|
30
|
+
const small = hasParts ? ShapeUtil.blob(-25, -138, 26, { seed: 14, lobes: 5, fill: second, extra: 'opacity="0.9"' }) + ShapeUtil.blob(-16, -172, 12, { seed: 15, lobes: 4, fill: ColorUtil.sh(second, 0.18), extra: 'opacity="0.7"' }) + ShapeUtil.blob(22, -165, 18, { seed: 16, lobes: 4, fill: second, extra: 'opacity="0.8"' }) : "";
|
|
31
|
+
const bark = isHigh ? `<path d="M-2 -10 L-2.5 -40 M2 -20 L2.5 -55 M-1 -60 L-1.5 -88" stroke="${ColorUtil.sh(theme.trunk, -0.3)}" stroke-width="0.9" stroke-linecap="round" fill="none"/>` : "";
|
|
32
|
+
const leaves = isHigh ? ShapeUtil.blob(-30, -170, 8, { seed: 17, lobes: 3, fill: ColorUtil.sh(first, 0.2), extra: 'opacity="0.55"' }) + ShapeUtil.blob(12, -178, 7, { seed: 18, lobes: 3, fill: ColorUtil.sh(second, 0.22), extra: 'opacity="0.55"' }) + ShapeUtil.blob(-36, -135, 6, { seed: 19, lobes: 3, fill: ColorUtil.sh(color, 0.22), extra: 'opacity="0.5"' }) + ShapeUtil.blob(34, -130, 6, { seed: 20, lobes: 3, fill: ColorUtil.sh(color, 0.22), extra: 'opacity="0.5"' }) : "";
|
|
33
|
+
return ShapeUtil.shadow(theme, 46, 4.5) + `<path d="M-8 0 L-5 -95 L5 -95 L8 0 Z" fill="${theme.trunk}"/><path d="M1 0 L1.5 -95 L5 -95 L8 0 Z" fill="${ColorUtil.sh(theme.trunk, -0.2)}"/>` + bark + branches + ShapeUtil.blob(-28, -125, 32, { seed: 11, lobes: 5, fill: color }) + ShapeUtil.blob(28, -122, 30, { seed: 12, lobes: 5, fill: ColorUtil.sh(color, -0.1) }) + ShapeUtil.blob(0, -155, 42, { seed: 13, lobes: 6, fill: ColorUtil.sh(first, -0.12) }) + ShapeUtil.blob(-3, -158, 40, { seed: 13, lobes: 6, fill: first }) + small + leaves;
|
|
34
|
+
}
|
|
35
|
+
drawTall(params, theme) {
|
|
36
|
+
const [first, second] = theme.foliage;
|
|
37
|
+
const trunkColor = theme.trunk;
|
|
38
|
+
return ShapeUtil.shadow(theme, 32, 4) + `<path d="M-5 0 L-3 -80 L3 -80 L5 0 Z" fill="${trunkColor}"/>` + ShapeUtil.blob(0, -110, 28, { seed: 21, lobes: 4, squash: 0.75, fill: ColorUtil.sh(second, -0.1) }) + ShapeUtil.blob(0, -145, 26, { seed: 22, lobes: 5, squash: 0.7, fill: first }) + ShapeUtil.blob(0, -175, 20, { seed: 23, lobes: 4, squash: 0.65, fill: ColorUtil.sh(first, 0.15) });
|
|
39
|
+
}
|
|
40
|
+
drawWide(params, theme) {
|
|
11
41
|
const [first, second, color] = theme.foliage;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-172,
|
|
15
|
-
12,
|
|
16
|
-
ColorUtil.sh(second, 0.18),
|
|
17
|
-
'opacity="0.7"'
|
|
18
|
-
) + ShapeUtil.circle(22, -165, 18, second, 'opacity="0.8"');
|
|
42
|
+
const trunkColor = theme.trunk;
|
|
43
|
+
return ShapeUtil.shadow(theme, 55, 4.5) + `<path d="M-10 0 L-18 -70 L-2 -70 L-3 0 Z" fill="${trunkColor}"/><path d="M3 0 L2 -70 L18 -70 L10 0 Z" fill="${trunkColor}"/>` + ShapeUtil.blob(-35, -115, 36, { seed: 25, lobes: 5, fill: second }) + ShapeUtil.blob(35, -115, 36, { seed: 26, lobes: 5, fill: ColorUtil.sh(color, -0.1) }) + ShapeUtil.blob(0, -135, 40, { seed: 27, lobes: 6, fill: first });
|
|
19
44
|
}
|
|
20
45
|
}
|
|
21
46
|
export {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AssetParams, Theme } from "../../Protocols/AssetProtocol.js";
|
|
2
|
+
import { BaseAsset } from "./BaseAsset.js";
|
|
3
|
+
export declare class WaterCoolerAsset extends BaseAsset {
|
|
4
|
+
readonly id = "water_cooler";
|
|
5
|
+
readonly kind = "ground";
|
|
6
|
+
readonly width = 36;
|
|
7
|
+
readonly height = 115;
|
|
8
|
+
readonly top = 85;
|
|
9
|
+
readonly tags: string[];
|
|
10
|
+
draw(params: AssetParams, theme: Theme): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ColorUtil } from "../../Utils/ColorUtil.js";
|
|
2
|
+
import { BaseAsset } from "./BaseAsset.js";
|
|
3
|
+
import { ShapeUtil } from "../../Utils/ShapeUtil.js";
|
|
4
|
+
class WaterCoolerAsset extends BaseAsset {
|
|
5
|
+
id = "water_cooler";
|
|
6
|
+
kind = "ground";
|
|
7
|
+
width = 36;
|
|
8
|
+
height = 115;
|
|
9
|
+
top = 85;
|
|
10
|
+
tags = ["bebedouro", "water_cooler", "water_dispenser", "water_bottle"];
|
|
11
|
+
draw(params, theme) {
|
|
12
|
+
const bodyColor = ShapeUtil.color(theme, params.color, theme.paper);
|
|
13
|
+
const bottleColor = "rgba(70, 160, 240, 0.75)";
|
|
14
|
+
const darkBody = ColorUtil.sh(theme.metal, -0.15);
|
|
15
|
+
return ShapeUtil.shadow(theme, 18, 3.5) + ShapeUtil.rect(-16, -85, 32, 85, bodyColor, { rx: 4 }) + ShapeUtil.rect(4, -85, 12, 85, ColorUtil.sh(bodyColor, -0.08), { rx: 4 }) + ShapeUtil.rect(-12, -75, 24, 25, darkBody, { rx: 3 }) + ShapeUtil.rect(-6, -72, 3, 6, "#E54D42", { rx: 1 }) + ShapeUtil.rect(3, -72, 3, 6, "#3B82F6", { rx: 1 }) + ShapeUtil.rect(-10, -53, 20, 2, theme.metal) + ShapeUtil.rect(-7, -90, 14, 6, darkBody, { rx: 2 }) + ShapeUtil.rect(-13, -115, 26, 25, bottleColor, { rx: 8 }) + ShapeUtil.rect(2, -115, 11, 25, "rgba(50, 130, 210, 0.6)", { rx: 8 });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
WaterCoolerAsset
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AssetParams, Theme } from "../../Protocols/AssetProtocol.js";
|
|
2
|
+
import { BaseAsset } from "./BaseAsset.js";
|
|
3
|
+
export declare class WhiteboardAsset extends BaseAsset {
|
|
4
|
+
readonly id = "whiteboard";
|
|
5
|
+
readonly kind = "ground";
|
|
6
|
+
readonly width = 120;
|
|
7
|
+
readonly height = 150;
|
|
8
|
+
readonly tags: string[];
|
|
9
|
+
draw(params: AssetParams, theme: Theme): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ColorUtil } from "../../Utils/ColorUtil.js";
|
|
2
|
+
import { BaseAsset } from "./BaseAsset.js";
|
|
3
|
+
import { ShapeUtil } from "../../Utils/ShapeUtil.js";
|
|
4
|
+
class WhiteboardAsset extends BaseAsset {
|
|
5
|
+
id = "whiteboard";
|
|
6
|
+
kind = "ground";
|
|
7
|
+
width = 120;
|
|
8
|
+
height = 150;
|
|
9
|
+
tags = ["quadro_branco", "lousa_branca", "whiteboard", "flipchart", "board_stand"];
|
|
10
|
+
draw(params, theme) {
|
|
11
|
+
const stand = theme.metal;
|
|
12
|
+
const tray = ColorUtil.sh(theme.metal, -0.2);
|
|
13
|
+
return ShapeUtil.shadow(theme, 55, 4) + `<path d="M-45 0 L-35 -140 M45 0 L35 -140" stroke="${stand}" stroke-width="4" stroke-linecap="round"/><path d="M-40 -40 L40 -40" stroke="${stand}" stroke-width="3"/>` + ShapeUtil.rect(-55, -145, 110, 80, stand, { rx: 4 }) + ShapeUtil.rect(-51, -141, 102, 72, theme.paper, { rx: 2 }) + ShapeUtil.rect(-45, -67, 90, 4, tray, { rx: 1 }) + `<path d="M-40 -125 Q-20 -130 0 -115 T40 -120" stroke="${theme.primary}" stroke-width="2.5" fill="none"/>` + ShapeUtil.rect(-35, -105, 18, 12, theme.accent, { rx: 2 }) + ShapeUtil.rect(-10, -105, 18, 12, theme.secondary, { rx: 2 }) + ShapeUtil.rect(15, -105, 18, 12, theme.primary, { rx: 2 });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
WhiteboardAsset
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ThemeColorName } from "../../Protocols/ThemeProtocol.js";
|
|
2
|
-
import type { KitId, KitLight, KitOutline, KitSceneName, KitStyle, KitTextureName } from "../../Protocols/KitProtocol.js";
|
|
2
|
+
import type { KitId, KitLight, KitOutline, KitSceneName, KitStyle, KitTextureName, FontName } from "../../Protocols/KitProtocol.js";
|
|
3
3
|
export declare abstract class BaseKit implements KitStyle {
|
|
4
4
|
abstract readonly id: KitId;
|
|
5
5
|
abstract readonly description: string;
|
|
@@ -9,4 +9,5 @@ export declare abstract class BaseKit implements KitStyle {
|
|
|
9
9
|
readonly themeColorToColor?: Partial<Record<ThemeColorName, string>>;
|
|
10
10
|
readonly scene?: KitSceneName;
|
|
11
11
|
readonly hasDrop?: boolean;
|
|
12
|
+
readonly font?: FontName;
|
|
12
13
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { KitLight } from "../../Protocols/KitProtocol.js";
|
|
2
|
+
import { BaseKit } from "./BaseKit.js";
|
|
3
|
+
export declare class ClayKit extends BaseKit {
|
|
4
|
+
readonly id = "clay";
|
|
5
|
+
readonly description = "clay: soft 3D rounded shapes, rim light and ambient occlusion";
|
|
6
|
+
readonly light: KitLight;
|
|
7
|
+
readonly hasDrop = true;
|
|
8
|
+
readonly scene = "clay";
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseKit } from "./BaseKit.js";
|
|
2
|
+
class ClayKit extends BaseKit {
|
|
3
|
+
id = "clay";
|
|
4
|
+
description = "clay: soft 3D rounded shapes, rim light and ambient occlusion";
|
|
5
|
+
light = { strength: 0.55 };
|
|
6
|
+
hasDrop = true;
|
|
7
|
+
scene = "clay";
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
ClayKit
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { KitLight } from "../../Protocols/KitProtocol.js";
|
|
2
|
+
import { BaseKit } from "./BaseKit.js";
|
|
3
|
+
export declare class DuotoneKit extends BaseKit {
|
|
4
|
+
readonly id = "duotone";
|
|
5
|
+
readonly description = "duotone: two inks mapped across luminance with halftone";
|
|
6
|
+
readonly light: KitLight;
|
|
7
|
+
readonly themeColorToColor: {
|
|
8
|
+
primary: string;
|
|
9
|
+
paper: string;
|
|
10
|
+
accent: string;
|
|
11
|
+
secondary: string;
|
|
12
|
+
text: string;
|
|
13
|
+
ink: string;
|
|
14
|
+
};
|
|
15
|
+
readonly scene = "duotone";
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseKit } from "./BaseKit.js";
|
|
2
|
+
class DuotoneKit extends BaseKit {
|
|
3
|
+
id = "duotone";
|
|
4
|
+
description = "duotone: two inks mapped across luminance with halftone";
|
|
5
|
+
light = { mode: "none" };
|
|
6
|
+
themeColorToColor = {
|
|
7
|
+
primary: "#1D2D50",
|
|
8
|
+
paper: "#F4EBD9",
|
|
9
|
+
accent: "#133B5C",
|
|
10
|
+
secondary: "#1E5F74",
|
|
11
|
+
text: "#1D2D50",
|
|
12
|
+
ink: "#1D2D50"
|
|
13
|
+
};
|
|
14
|
+
scene = "duotone";
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
DuotoneKit
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { KitLight } from "../../Protocols/KitProtocol.js";
|
|
2
|
+
import { BaseKit } from "./BaseKit.js";
|
|
3
|
+
export declare class IsometricKit extends BaseKit {
|
|
4
|
+
readonly id = "isometric";
|
|
5
|
+
readonly description = "isometric: 30\u00B0 axonometric projection with flat faces, hatched shadow planes and a drop shadow";
|
|
6
|
+
readonly light: KitLight;
|
|
7
|
+
readonly hasDrop = true;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseKit } from "./BaseKit.js";
|
|
2
|
+
class IsometricKit extends BaseKit {
|
|
3
|
+
id = "isometric";
|
|
4
|
+
description = "isometric: 30\xB0 axonometric projection with flat faces, hatched shadow planes and a drop shadow";
|
|
5
|
+
light = { mode: "hatch", strength: 0.6 };
|
|
6
|
+
hasDrop = true;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
IsometricKit
|
|
10
|
+
};
|
|
@@ -2,7 +2,7 @@ import { BaseKit } from "./BaseKit.js";
|
|
|
2
2
|
class OutlineKit extends BaseKit {
|
|
3
3
|
id = "outline";
|
|
4
4
|
description = "cartoon outline: thick border on the silhouette and a thin line inside";
|
|
5
|
-
outline = { w: 2.6, inner: 0.9 };
|
|
5
|
+
outline = { w: 2.6, inner: 0.9, wobble: 1.25, weight: 0.45, detailRatio: 0.55 };
|
|
6
6
|
light = { strength: 0.45 };
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FontName } from "../../Protocols/KitProtocol.js";
|
|
1
2
|
import { BaseKit } from "./BaseKit.js";
|
|
2
3
|
export declare class PaperKit extends BaseKit {
|
|
3
4
|
readonly id = "paper";
|
|
@@ -8,4 +9,5 @@ export declare class PaperKit extends BaseKit {
|
|
|
8
9
|
};
|
|
9
10
|
readonly hasDrop = true;
|
|
10
11
|
readonly texture = "fiber";
|
|
12
|
+
readonly font: FontName;
|
|
11
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KitLight } from "../../Protocols/KitProtocol.js";
|
|
2
|
+
import { BaseKit } from "./BaseKit.js";
|
|
3
|
+
export declare class PosterKit extends BaseKit {
|
|
4
|
+
readonly id = "poster";
|
|
5
|
+
readonly description = "vintage poster: limited 4\u20135 colors, coarse halftone shadows, sun-faded grade";
|
|
6
|
+
readonly light: KitLight;
|
|
7
|
+
readonly themeColorToColor: {
|
|
8
|
+
paper: string;
|
|
9
|
+
text: string;
|
|
10
|
+
ink: string;
|
|
11
|
+
};
|
|
12
|
+
readonly scene = "poster";
|
|
13
|
+
readonly texture = "paper";
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseKit } from "./BaseKit.js";
|
|
2
|
+
class PosterKit extends BaseKit {
|
|
3
|
+
id = "poster";
|
|
4
|
+
description = "vintage poster: limited 4\u20135 colors, coarse halftone shadows, sun-faded grade";
|
|
5
|
+
light = { mode: "none" };
|
|
6
|
+
themeColorToColor = {
|
|
7
|
+
paper: "#F7F2E7",
|
|
8
|
+
text: "#2B2118",
|
|
9
|
+
ink: "#2B2118"
|
|
10
|
+
};
|
|
11
|
+
scene = "poster";
|
|
12
|
+
texture = "paper";
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
PosterKit
|
|
16
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KitLight } from "../../Protocols/KitProtocol.js";
|
|
1
|
+
import type { FontName, KitLight } from "../../Protocols/KitProtocol.js";
|
|
2
2
|
import { BaseKit } from "./BaseKit.js";
|
|
3
3
|
export declare class SketchKit extends BaseKit {
|
|
4
4
|
readonly id = "sketch";
|
|
@@ -6,4 +6,5 @@ export declare class SketchKit extends BaseKit {
|
|
|
6
6
|
readonly light: KitLight;
|
|
7
7
|
readonly scene = "sketch";
|
|
8
8
|
readonly texture = "paper";
|
|
9
|
+
readonly font: FontName;
|
|
9
10
|
}
|
|
@@ -86,6 +86,20 @@ import { PlasticBagAsset } from "../Resources/Assets/PlasticBagAsset.js";
|
|
|
86
86
|
import { CablesAsset } from "../Resources/Assets/CablesAsset.js";
|
|
87
87
|
import { LightSwitchAsset } from "../Resources/Assets/LightSwitchAsset.js";
|
|
88
88
|
import { GlassShelfAsset } from "../Resources/Assets/GlassShelfAsset.js";
|
|
89
|
+
import { RefrigeratorAsset } from "../Resources/Assets/RefrigeratorAsset.js";
|
|
90
|
+
import { StoveAsset } from "../Resources/Assets/StoveAsset.js";
|
|
91
|
+
import { SinkAsset } from "../Resources/Assets/SinkAsset.js";
|
|
92
|
+
import { WhiteboardAsset } from "../Resources/Assets/WhiteboardAsset.js";
|
|
93
|
+
import { WaterCoolerAsset } from "../Resources/Assets/WaterCoolerAsset.js";
|
|
94
|
+
import { FirstAidKitAsset } from "../Resources/Assets/FirstAidKitAsset.js";
|
|
95
|
+
import { StethoscopeAsset } from "../Resources/Assets/StethoscopeAsset.js";
|
|
96
|
+
import { BlackboardAsset } from "../Resources/Assets/BlackboardAsset.js";
|
|
97
|
+
import { GlobeAsset } from "../Resources/Assets/GlobeAsset.js";
|
|
98
|
+
import { PodiumAsset } from "../Resources/Assets/PodiumAsset.js";
|
|
99
|
+
import { ConfettiAsset } from "../Resources/Assets/ConfettiAsset.js";
|
|
100
|
+
import { CursorAsset } from "../Resources/Assets/CursorAsset.js";
|
|
101
|
+
import { ToggleAsset } from "../Resources/Assets/ToggleAsset.js";
|
|
102
|
+
import { ChatBubbleAsset } from "../Resources/Assets/ChatBubbleAsset.js";
|
|
89
103
|
class AssetService {
|
|
90
104
|
static CANDIDATE_POOL = 6;
|
|
91
105
|
static SUGGESTION_COUNT = 3;
|
|
@@ -176,7 +190,21 @@ class AssetService {
|
|
|
176
190
|
new PlasticBagAsset(),
|
|
177
191
|
new CablesAsset(),
|
|
178
192
|
new LightSwitchAsset(),
|
|
179
|
-
new GlassShelfAsset()
|
|
193
|
+
new GlassShelfAsset(),
|
|
194
|
+
new RefrigeratorAsset(),
|
|
195
|
+
new StoveAsset(),
|
|
196
|
+
new SinkAsset(),
|
|
197
|
+
new WhiteboardAsset(),
|
|
198
|
+
new WaterCoolerAsset(),
|
|
199
|
+
new FirstAidKitAsset(),
|
|
200
|
+
new StethoscopeAsset(),
|
|
201
|
+
new BlackboardAsset(),
|
|
202
|
+
new GlobeAsset(),
|
|
203
|
+
new PodiumAsset(),
|
|
204
|
+
new ConfettiAsset(),
|
|
205
|
+
new CursorAsset(),
|
|
206
|
+
new ToggleAsset(),
|
|
207
|
+
new ChatBubbleAsset()
|
|
180
208
|
]
|
|
181
209
|
);
|
|
182
210
|
static resolveAsset(name, library = AssetService.ASSET_ID_TO_ASSET) {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { Background, CompilationContext } from "../Protocols/CompilationProtocol.js";
|
|
1
|
+
import type { Background, CompilationContext, Placement, TextRect } from "../Protocols/CompilationProtocol.js";
|
|
2
|
+
export interface BackgroundBuildOptions {
|
|
3
|
+
textRects?: readonly TextRect[];
|
|
4
|
+
placements?: readonly Placement[];
|
|
5
|
+
}
|
|
2
6
|
export declare class BackgroundService {
|
|
3
7
|
private static readonly OUTDOOR_HAZE;
|
|
4
8
|
private static readonly INDOOR_HAZE;
|
|
@@ -12,13 +16,17 @@ export declare class BackgroundService {
|
|
|
12
16
|
private static readonly BOARD_LINES;
|
|
13
17
|
private static readonly CITY_DASHES;
|
|
14
18
|
private static readonly WAVE_COUNT;
|
|
19
|
+
private static readonly DEFAULT_RIDGES;
|
|
20
|
+
private static readonly DEFAULT_SEED;
|
|
15
21
|
private static readonly SETTING_TO_HAZE;
|
|
22
|
+
private static readonly SETTING_TO_DEFAULT_RIDGES;
|
|
23
|
+
private static readonly SETTING_TO_DEFAULT_GROUND_DETAIL;
|
|
16
24
|
private static readonly SETTING_TO_AIR;
|
|
17
25
|
private static readonly SETTING_TO_OUTDOOR_DRAWER;
|
|
18
26
|
private static readonly SETTING_TO_HILLS;
|
|
19
27
|
private static readonly SETTING_TO_FOREGROUND;
|
|
20
28
|
private static readonly FLOOR_TO_DRAWER;
|
|
21
|
-
static build(context: CompilationContext): Background;
|
|
29
|
+
static build(context: CompilationContext, options?: BackgroundBuildOptions): Background;
|
|
22
30
|
private static hazeLevels;
|
|
23
31
|
private static shadowRgba;
|
|
24
32
|
private static hazeFilter;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ColorUtil } from "../Utils/ColorUtil.js";
|
|
2
2
|
import { IdUtil } from "../Utils/IdUtil.js";
|
|
3
|
+
import { GroundDetailService } from "./GroundDetailService.js";
|
|
4
|
+
import { RidgeService } from "./RidgeService.js";
|
|
5
|
+
import { SkyDetailService } from "./SkyDetailService.js";
|
|
3
6
|
class BackgroundService {
|
|
4
7
|
static OUTDOOR_HAZE = { far: 0.32, mid: 0.13 };
|
|
5
8
|
static INDOOR_HAZE = { far: 0.08, mid: 0.04 };
|
|
@@ -13,9 +16,17 @@ class BackgroundService {
|
|
|
13
16
|
static BOARD_LINES = 8;
|
|
14
17
|
static CITY_DASHES = 10;
|
|
15
18
|
static WAVE_COUNT = 6;
|
|
19
|
+
static DEFAULT_RIDGES = 2;
|
|
20
|
+
static DEFAULT_SEED = 1;
|
|
16
21
|
static SETTING_TO_HAZE = {
|
|
17
22
|
indoor: BackgroundService.INDOOR_HAZE
|
|
18
23
|
};
|
|
24
|
+
static SETTING_TO_DEFAULT_RIDGES = {
|
|
25
|
+
outdoor: BackgroundService.DEFAULT_RIDGES
|
|
26
|
+
};
|
|
27
|
+
static SETTING_TO_DEFAULT_GROUND_DETAIL = {
|
|
28
|
+
outdoor: "low"
|
|
29
|
+
};
|
|
19
30
|
static SETTING_TO_AIR = { indoor: "wall" };
|
|
20
31
|
static SETTING_TO_OUTDOOR_DRAWER = {
|
|
21
32
|
beach: (context) => BackgroundService.beach(context)
|
|
@@ -29,7 +40,7 @@ class BackgroundService {
|
|
|
29
40
|
static FLOOR_TO_DRAWER = {
|
|
30
41
|
planks: (context) => BackgroundService.planks(context)
|
|
31
42
|
};
|
|
32
|
-
static build(context) {
|
|
43
|
+
static build(context, options) {
|
|
33
44
|
const { theme, setting } = context;
|
|
34
45
|
const haze = BackgroundService.hazeLevels(context);
|
|
35
46
|
const shadowRgba = BackgroundService.shadowRgba(theme);
|
|
@@ -38,7 +49,7 @@ class BackgroundService {
|
|
|
38
49
|
return { svg: defs + BackgroundService.indoor(context), haze, shadowRgba, textBackdrop: theme.wall };
|
|
39
50
|
}
|
|
40
51
|
const drawOutdoor = IdUtil.lookup(BackgroundService.SETTING_TO_OUTDOOR_DRAWER, setting);
|
|
41
|
-
const outdoor = drawOutdoor ? drawOutdoor(context) : BackgroundService.open(context);
|
|
52
|
+
const outdoor = drawOutdoor ? drawOutdoor(context, options) : BackgroundService.open(context, options);
|
|
42
53
|
return { svg: defs + outdoor, haze, shadowRgba, textBackdrop: theme.skyTop };
|
|
43
54
|
}
|
|
44
55
|
static hazeLevels(context) {
|
|
@@ -66,12 +77,14 @@ class BackgroundService {
|
|
|
66
77
|
const shadowColor = `rgb(${red},${green},${blue})`;
|
|
67
78
|
const hazeFar = BackgroundService.hazeFilter("hazeFar", haze.far, air);
|
|
68
79
|
const hazeMid = BackgroundService.hazeFilter("hazeMid", haze.mid, air);
|
|
69
|
-
|
|
80
|
+
const groundDef = GroundDetailService.groundGradientDef(theme);
|
|
81
|
+
const ditherDef = `<filter id="dither"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="1" stitchTiles="stitch" result="nz"/><feColorMatrix in="nz" type="matrix" values="0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.012 0" result="d"/><feBlend in="SourceGraphic" in2="d" mode="soft-light"/></filter>`;
|
|
82
|
+
return `<defs><linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">${SkyDetailService.skyGradientStops(theme)}</linearGradient>` + ditherDef + groundDef + `<radialGradient id="cshadow"><stop offset="0" stop-color="${shadowColor}" stop-opacity="${alpha * 1.5}"/><stop offset="0.55" stop-color="${shadowColor}" stop-opacity="${alpha * 1.1}"/><stop offset="1" stop-color="${shadowColor}" stop-opacity="0"/></radialGradient>` + hazeFar + hazeMid + "</defs>";
|
|
70
83
|
}
|
|
71
84
|
static indoor(context) {
|
|
72
85
|
const { theme, width, height, lines, canvas } = context;
|
|
73
86
|
const horizonY = height * lines.horizon;
|
|
74
|
-
const base = `<rect width="${width}" height="${horizonY}" fill="${theme.wall}"/><rect y="${horizonY}" width="${width}" height="${height - horizonY}" fill="${theme.floor}"/><rect y="${horizonY - 8}" width="${width}" height="10" fill="${theme.woodDark}" opacity="0.35"/>`;
|
|
87
|
+
const base = `<rect width="${width}" height="${horizonY}" fill="${theme.wall}" filter="url(#dither)"/><rect y="${horizonY}" width="${width}" height="${height - horizonY}" fill="${theme.floor}"/><rect y="${horizonY - 8}" width="${width}" height="10" fill="${theme.woodDark}" opacity="0.35"/>`;
|
|
75
88
|
const drawFloor = IdUtil.lookup(BackgroundService.FLOOR_TO_DRAWER, canvas.floor);
|
|
76
89
|
return base + (drawFloor ? drawFloor(context) : BackgroundService.floorLines(context));
|
|
77
90
|
}
|
|
@@ -106,24 +119,52 @@ class BackgroundService {
|
|
|
106
119
|
const { theme, width, height, lines } = context;
|
|
107
120
|
const horizonY = height * lines.horizon;
|
|
108
121
|
const seaY = height * (lines.sea ?? lines.horizon);
|
|
109
|
-
let svg = `<rect width="${width}" height="${height}" fill="url(#sky)"/><rect y="${horizonY}" width="${width}" height="${seaY - horizonY}" fill="${theme.sea}"/><path d="M0 ${seaY} Q${width * 0.25} ${seaY - 14} ${width * 0.5} ${seaY} T${width} ${seaY} L${width} ${height} L0 ${height} Z" fill="${theme.ground}"/>`;
|
|
122
|
+
let svg = `<rect width="${width}" height="${height}" fill="url(#sky)" filter="url(#dither)"/><rect y="${horizonY}" width="${width}" height="${seaY - horizonY}" fill="${theme.sea}"/><path d="M0 ${seaY} Q${width * 0.25} ${seaY - 14} ${width * 0.5} ${seaY} T${width} ${seaY} L${width} ${height} L0 ${height} Z" fill="${theme.ground}"/>`;
|
|
110
123
|
for (let index = 0; index < BackgroundService.WAVE_COUNT; index++) {
|
|
111
124
|
svg += `<path d="M${width * (0.08 + index * 0.17)} ${horizonY + 18 + index % 3 * 22} q14 -6 28 0" stroke="${theme.seaLight}" stroke-width="3" fill="none" stroke-linecap="round"/>`;
|
|
112
125
|
}
|
|
113
126
|
return svg + `<path d="M0 ${seaY - 4} Q${width * 0.25} ${seaY - 18} ${width * 0.5} ${seaY - 4} T${width} ${seaY - 4}" stroke="${theme.paper}" stroke-width="4" fill="none" opacity="0.7"/>`;
|
|
114
127
|
}
|
|
115
128
|
static hills(context) {
|
|
116
|
-
const { theme, width, height, lines } = context;
|
|
129
|
+
const { theme, width, height, lines, canvas, setting } = context;
|
|
117
130
|
const horizonY = height * lines.horizon;
|
|
118
|
-
|
|
131
|
+
const defaultRidges = IdUtil.lookup(BackgroundService.SETTING_TO_DEFAULT_RIDGES, setting) ?? 0;
|
|
132
|
+
const count = canvas.ridges ?? defaultRidges;
|
|
133
|
+
return RidgeService.draw({
|
|
134
|
+
count,
|
|
135
|
+
seed: canvas.seed ?? BackgroundService.DEFAULT_SEED,
|
|
136
|
+
width,
|
|
137
|
+
horizonY,
|
|
138
|
+
groundColor: theme.groundDark || theme.ground,
|
|
139
|
+
airColor: theme.skyBottom,
|
|
140
|
+
bottomY: height
|
|
141
|
+
});
|
|
119
142
|
}
|
|
120
|
-
static open(context) {
|
|
121
|
-
const { theme, width, height, lines, setting } = context;
|
|
143
|
+
static open(context, options) {
|
|
144
|
+
const { theme, width, height, lines, setting, canvas } = context;
|
|
122
145
|
const horizonY = height * lines.horizon;
|
|
123
146
|
const drawHills = IdUtil.lookup(BackgroundService.SETTING_TO_HILLS, setting);
|
|
124
147
|
const drawForeground = IdUtil.lookup(BackgroundService.SETTING_TO_FOREGROUND, setting);
|
|
125
|
-
const
|
|
126
|
-
|
|
148
|
+
const clouds = SkyDetailService.ambientClouds({
|
|
149
|
+
density: canvas.clouds,
|
|
150
|
+
seed: canvas.seed ?? BackgroundService.DEFAULT_SEED,
|
|
151
|
+
width,
|
|
152
|
+
horizonY,
|
|
153
|
+
paperColor: theme.paper,
|
|
154
|
+
textRects: options?.textRects
|
|
155
|
+
});
|
|
156
|
+
const defaultGroundDetail = IdUtil.lookup(BackgroundService.SETTING_TO_DEFAULT_GROUND_DETAIL, setting) ?? "none";
|
|
157
|
+
const groundDetail = GroundDetailService.draw({
|
|
158
|
+
detail: canvas.ground_detail ?? defaultGroundDetail,
|
|
159
|
+
seed: canvas.seed ?? BackgroundService.DEFAULT_SEED,
|
|
160
|
+
width,
|
|
161
|
+
height,
|
|
162
|
+
horizonY,
|
|
163
|
+
theme,
|
|
164
|
+
placements: options?.placements
|
|
165
|
+
});
|
|
166
|
+
const svg = `<rect width="${width}" height="${height}" fill="url(#sky)" filter="url(#dither)"/>` + clouds + (drawHills ? drawHills(context, options) : "") + `<path d="M0 ${horizonY + 12} Q${width * 0.3} ${horizonY - 6} ${width * 0.6} ${horizonY + 10} T${width} ${horizonY + 4} L${width} ${height} L0 ${height} Z" fill="url(#ground)"/>` + groundDetail;
|
|
167
|
+
return drawForeground ? svg + drawForeground(context, options) : svg;
|
|
127
168
|
}
|
|
128
169
|
static street(context) {
|
|
129
170
|
const { theme, width, height } = context;
|
|
@@ -3,7 +3,7 @@ import { THEME_IDS } from "../Protocols/ThemeProtocol.js";
|
|
|
3
3
|
import { PersonUtil } from "../Utils/PersonUtil.js";
|
|
4
4
|
import { KitService } from "./KitService.js";
|
|
5
5
|
import { AssetService } from "./AssetService.js";
|
|
6
|
-
import { DEPTH_NAMES, SETTING_NAMES, SHOT_NAMES, SIZE_NAMES, SLOT_NAMES } from "../Protocols/SceneProtocol.js";
|
|
6
|
+
import { DEPTH_NAMES, HARMONY_NAMES, MOOD_NAMES, SETTING_NAMES, SHOT_NAMES, SIZE_NAMES, SLOT_NAMES } from "../Protocols/SceneProtocol.js";
|
|
7
7
|
class CatalogService {
|
|
8
8
|
static CATALOG_KINDS = ["assets", "groups", "kits", "themes", "poses", "layout"];
|
|
9
9
|
static listAssets() {
|
|
@@ -12,7 +12,8 @@ class CatalogService {
|
|
|
12
12
|
kind: asset.kind,
|
|
13
13
|
width: asset.width,
|
|
14
14
|
height: asset.height,
|
|
15
|
-
synonyms: [...asset.tags]
|
|
15
|
+
synonyms: [...asset.tags],
|
|
16
|
+
...asset.variants ? { variants: [...asset.variants] } : {}
|
|
16
17
|
}));
|
|
17
18
|
}
|
|
18
19
|
static listGroups() {
|
|
@@ -32,7 +33,11 @@ class CatalogService {
|
|
|
32
33
|
assets: () => CatalogService.listAssets(),
|
|
33
34
|
groups: () => CatalogService.listGroups(),
|
|
34
35
|
kits: () => CatalogService.listKits(),
|
|
35
|
-
themes: () =>
|
|
36
|
+
themes: () => ({
|
|
37
|
+
presets: CatalogService.listThemes(),
|
|
38
|
+
harmonies: HARMONY_NAMES,
|
|
39
|
+
moods: MOOD_NAMES
|
|
40
|
+
}),
|
|
36
41
|
poses: () => ({ ...PersonUtil.POSE_NAMES, expressions: PersonUtil.EXPRESSION_NAMES }),
|
|
37
42
|
layout: () => ({
|
|
38
43
|
slots: SLOT_NAMES,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Raster } from "../Protocols/CritiqueProtocol.js";
|
|
2
|
+
export declare class ColorCritiqueService {
|
|
3
|
+
private static readonly DARK_BAND_MAX;
|
|
4
|
+
private static readonly LIGHT_BAND_MIN;
|
|
5
|
+
private static readonly MAX_SINGLE_BAND_SHARE;
|
|
6
|
+
private static readonly MAX_LIGHT_BAND_SHARE;
|
|
7
|
+
private static readonly NEUTRAL_CHROMA;
|
|
8
|
+
private static readonly CLASH_CHROMA_THRESHOLD;
|
|
9
|
+
private static readonly ANALOGOUS_MAX_DEG;
|
|
10
|
+
private static readonly COMPLEMENTARY_MIN_DEG;
|
|
11
|
+
private static readonly COMPLEMENTARY_MAX_DEG;
|
|
12
|
+
private static readonly MIN_CLASH_PIXELS;
|
|
13
|
+
private static readonly MIN_DOMINANT_WEIGHT_SHARE;
|
|
14
|
+
private static readonly MIN_SCENE_COVERAGE;
|
|
15
|
+
private static readonly HUE_BIN_COUNT;
|
|
16
|
+
private static readonly FULL_CIRCLE_DEG;
|
|
17
|
+
private static readonly HALF_CIRCLE_DEG;
|
|
18
|
+
private static readonly HEX_RADIX;
|
|
19
|
+
private static readonly BACKGROUND_KINDS;
|
|
20
|
+
private static readonly CHANNELS;
|
|
21
|
+
private static readonly RED_OFFSET;
|
|
22
|
+
private static readonly GREEN_OFFSET;
|
|
23
|
+
private static readonly BLUE_OFFSET;
|
|
24
|
+
private static readonly OPAQUE_ALPHA;
|
|
25
|
+
private static readonly LAB_L_OFFSET;
|
|
26
|
+
private static readonly LAB_A_OFFSET;
|
|
27
|
+
private static readonly LAB_B_OFFSET;
|
|
28
|
+
private static readonly LAB_CHANNELS;
|
|
29
|
+
static critique(raster: Raster): string[];
|
|
30
|
+
private static countValueBands;
|
|
31
|
+
private static checkValueStructure;
|
|
32
|
+
private static checkHarmony;
|
|
33
|
+
private static dominantHueClusters;
|
|
34
|
+
private static closestDominant;
|
|
35
|
+
private static isHarmonious;
|
|
36
|
+
private static clashOnObject;
|
|
37
|
+
private static modalHex;
|
|
38
|
+
private static hexByte;
|
|
39
|
+
private static hueOf;
|
|
40
|
+
private static circularDistance;
|
|
41
|
+
private static largestGroundObject;
|
|
42
|
+
}
|