phaser-wind 0.2.0 → 0.3.0

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.
Files changed (113) hide show
  1. package/README.md +124 -135
  2. package/dist/core/color.d.ts +287 -0
  3. package/dist/core/color.d.ts.map +1 -0
  4. package/dist/core/color.js +386 -0
  5. package/dist/core/color.js.map +1 -0
  6. package/dist/core/color.spec.d.ts +2 -0
  7. package/dist/core/color.spec.d.ts.map +1 -0
  8. package/dist/core/color.spec.js +252 -0
  9. package/dist/core/color.spec.js.map +1 -0
  10. package/dist/core/font-size.d.ts +34 -0
  11. package/dist/core/font-size.d.ts.map +1 -0
  12. package/dist/core/font-size.js +68 -0
  13. package/dist/core/font-size.js.map +1 -0
  14. package/dist/core/font-size.spec.d.ts +2 -0
  15. package/dist/core/font-size.spec.d.ts.map +1 -0
  16. package/dist/core/font-size.spec.js +73 -0
  17. package/dist/core/font-size.spec.js.map +1 -0
  18. package/dist/{font/font-picker.d.ts → core/font.d.ts} +22 -21
  19. package/dist/core/font.d.ts.map +1 -0
  20. package/dist/{font/font-picker.js → core/font.js} +28 -62
  21. package/dist/core/font.js.map +1 -0
  22. package/dist/core/font.spec.d.ts +2 -0
  23. package/dist/core/font.spec.d.ts.map +1 -0
  24. package/dist/core/font.spec.js +84 -0
  25. package/dist/core/font.spec.js.map +1 -0
  26. package/dist/core/index.d.ts +8 -0
  27. package/dist/core/index.d.ts.map +1 -0
  28. package/dist/core/index.js +8 -0
  29. package/dist/core/index.js.map +1 -0
  30. package/dist/{color → core}/pallete.d.ts.map +1 -1
  31. package/dist/core/pallete.js.map +1 -0
  32. package/dist/core/radius.d.ts +34 -0
  33. package/dist/core/radius.d.ts.map +1 -0
  34. package/dist/core/radius.js +46 -0
  35. package/dist/core/radius.js.map +1 -0
  36. package/dist/core/radius.spec.d.ts +2 -0
  37. package/dist/core/radius.spec.d.ts.map +1 -0
  38. package/dist/core/radius.spec.js +61 -0
  39. package/dist/core/radius.spec.js.map +1 -0
  40. package/dist/core/shadow.d.ts +23 -0
  41. package/dist/core/shadow.d.ts.map +1 -0
  42. package/dist/core/shadow.js +23 -0
  43. package/dist/core/shadow.js.map +1 -0
  44. package/dist/core/spacing.d.ts +39 -0
  45. package/dist/core/spacing.d.ts.map +1 -0
  46. package/dist/core/spacing.js +82 -0
  47. package/dist/core/spacing.js.map +1 -0
  48. package/dist/core/spacing.spec.d.ts +2 -0
  49. package/dist/core/spacing.spec.d.ts.map +1 -0
  50. package/dist/core/spacing.spec.js +49 -0
  51. package/dist/core/spacing.spec.js.map +1 -0
  52. package/dist/font/index.d.ts +2 -2
  53. package/dist/font/index.d.ts.map +1 -1
  54. package/dist/font/index.js +2 -2
  55. package/dist/font/index.js.map +1 -1
  56. package/dist/index.d.ts +2 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +2 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/theme/theme-config.d.ts +31 -95
  61. package/dist/theme/theme-config.d.ts.map +1 -1
  62. package/dist/theme/theme-config.js +12 -52
  63. package/dist/theme/theme-config.js.map +1 -1
  64. package/dist/theme/theme-manager.d.ts +18 -6
  65. package/dist/theme/theme-manager.d.ts.map +1 -1
  66. package/dist/theme/theme-manager.js +25 -6
  67. package/dist/theme/theme-manager.js.map +1 -1
  68. package/dist/utils/index.d.ts +2 -0
  69. package/dist/utils/index.d.ts.map +1 -0
  70. package/dist/utils/index.js +2 -0
  71. package/dist/utils/index.js.map +1 -0
  72. package/dist/utils/is-valid-color.d.ts +13 -0
  73. package/dist/utils/is-valid-color.d.ts.map +1 -0
  74. package/dist/utils/is-valid-color.js +32 -0
  75. package/dist/utils/is-valid-color.js.map +1 -0
  76. package/dist/utils/is-valid-color.spec.d.ts +2 -0
  77. package/dist/utils/is-valid-color.spec.d.ts.map +1 -0
  78. package/dist/utils/is-valid-color.spec.js +82 -0
  79. package/dist/utils/is-valid-color.spec.js.map +1 -0
  80. package/package.json +5 -3
  81. package/dist/color/color-picker.d.ts +0 -23
  82. package/dist/color/color-picker.d.ts.map +0 -1
  83. package/dist/color/color-picker.js +0 -118
  84. package/dist/color/color-picker.js.map +0 -1
  85. package/dist/color/color-picker.spec.d.ts +0 -2
  86. package/dist/color/color-picker.spec.d.ts.map +0 -1
  87. package/dist/color/color-picker.spec.js +0 -60
  88. package/dist/color/color-picker.spec.js.map +0 -1
  89. package/dist/color/index.d.ts +0 -3
  90. package/dist/color/index.d.ts.map +0 -1
  91. package/dist/color/index.js +0 -3
  92. package/dist/color/index.js.map +0 -1
  93. package/dist/color/pallete.js.map +0 -1
  94. package/dist/examples/nested-theme-example.d.ts +0 -28
  95. package/dist/examples/nested-theme-example.d.ts.map +0 -1
  96. package/dist/examples/nested-theme-example.js +0 -313
  97. package/dist/examples/nested-theme-example.js.map +0 -1
  98. package/dist/examples/usage-example.d.ts +0 -17
  99. package/dist/examples/usage-example.d.ts.map +0 -1
  100. package/dist/examples/usage-example.js +0 -158
  101. package/dist/examples/usage-example.js.map +0 -1
  102. package/dist/font/font-picker.d.ts.map +0 -1
  103. package/dist/font/font-picker.js.map +0 -1
  104. package/dist/font/font-size-picker.d.ts +0 -19
  105. package/dist/font/font-size-picker.d.ts.map +0 -1
  106. package/dist/font/font-size-picker.js +0 -24
  107. package/dist/font/font-size-picker.js.map +0 -1
  108. package/dist/font/font-size-picker.spec.d.ts +0 -2
  109. package/dist/font/font-size-picker.spec.d.ts.map +0 -1
  110. package/dist/font/font-size-picker.spec.js +0 -48
  111. package/dist/font/font-size-picker.spec.js.map +0 -1
  112. /package/dist/{color → core}/pallete.d.ts +0 -0
  113. /package/dist/{color → core}/pallete.js +0 -0
package/README.md CHANGED
@@ -37,18 +37,18 @@ const title = this.add.text(200, 100, 'Game Title', {
37
37
  ### The Solution 🌟
38
38
 
39
39
  ```typescript
40
- import { ColorPicker, FontSizePicker } from 'phaser-wind';
40
+ import { Color, FontSize } from 'phaser-wind';
41
41
 
42
42
  // Clean, semantic, consistent!
43
43
  const button = this.add.text(100, 50, 'Click me!', {
44
- fontSize: FontSizePicker.css('lg'), // Clear intention!
45
- fill: ColorPicker.rgb('blue-500'), // Beautiful blue
46
- backgroundColor: ColorPicker.rgb('gray-800'), // Perfect contrast
44
+ fontSize: FontSize.css('lg'), // Clear intention!
45
+ fill: Color.rgb('blue-500'), // Beautiful blue
46
+ backgroundColor: Color.rgb('gray-800'), // Perfect contrast
47
47
  });
48
48
 
49
49
  const title = this.add.text(200, 100, 'Game Title', {
50
- fontSize: FontSizePicker.css('3xl'), // Clearly bigger!
51
- fill: ColorPicker.rgb('red-500'), // Vibrant red
50
+ fontSize: FontSize.css('3xl'), // Clearly bigger!
51
+ fill: Color.rgb('red-500'), // Vibrant red
52
52
  });
53
53
  ```
54
54
 
@@ -87,19 +87,19 @@ pnpm add phaser-wind
87
87
  Access all Tailwind colors with semantic naming:
88
88
 
89
89
  ```typescript
90
- import { ColorPicker } from 'phaser-wind';
90
+ import { Color } from 'phaser-wind';
91
91
 
92
92
  // RGB strings (for Phaser text styles)
93
- const blueText = ColorPicker.rgb('blue-500'); // 'rgb(59, 130, 246)'
94
- const redButton = ColorPicker.rgb('red-600'); // 'rgb(220, 38, 38)'
93
+ const blueText = Color.rgb('blue-500'); // 'rgb(59, 130, 246)'
94
+ const redButton = Color.rgb('red-600'); // 'rgb(220, 38, 38)'
95
95
 
96
96
  // Hex numbers (for Phaser graphics)
97
- const greenRect = ColorPicker.hex('green-400'); // 0x4ADE80
98
- const purpleCircle = ColorPicker.hex('purple-300'); // 0xD8B4FE
97
+ const greenRect = Color.hex('green-400'); // 0x4ADE80
98
+ const purpleCircle = Color.hex('purple-300'); // 0xD8B4FE
99
99
 
100
100
  // Basic colors
101
- const blackText = ColorPicker.rgb('black'); // 'rgb(0, 0, 0)'
102
- const whiteBackground = ColorPicker.hex('white'); // 0xFFFFFF
101
+ const blackText = Color.rgb('black'); // 'rgb(0, 0, 0)'
102
+ const whiteBackground = Color.hex('white'); // 0xFFFFFF
103
103
  ```
104
104
 
105
105
  ### Available Colors
@@ -117,35 +117,35 @@ const whiteBackground = ColorPicker.hex('white'); // 0xFFFFFF
117
117
  Stop guessing font sizes and use semantic tokens:
118
118
 
119
119
  ```typescript
120
- import { FontSizePicker } from 'phaser-wind';
120
+ import { FontSize } from 'phaser-wind';
121
121
 
122
122
  // Get pixel values
123
- const smallText = FontSizePicker.px('sm'); // 14
124
- const normalText = FontSizePicker.px('md'); // 16
125
- const largeTitle = FontSizePicker.px('3xl'); // 30
123
+ const smallText = FontSize.px('sm'); // 14
124
+ const normalText = FontSize.px('base'); // 16
125
+ const largeTitle = FontSize.px('3xl'); // 30
126
126
 
127
127
  // Get CSS strings (perfect for Phaser)
128
- const buttonText = FontSizePicker.css('lg'); // '18px'
129
- const heroTitle = FontSizePicker.css('6xl'); // '60px'
128
+ const buttonText = FontSize.css('lg'); // '18px'
129
+ const heroTitle = FontSize.css('6xl'); // '60px'
130
130
 
131
131
  // Get rem values (if needed)
132
- const responsiveText = FontSizePicker.rem('xl'); // 1.25
132
+ const responsiveText = FontSize.rem('xl'); // 1.25
133
133
  ```
134
134
 
135
135
  ### Font Size Scale
136
136
 
137
- | Token | Pixels | Use Case |
138
- | ----- | ------ | ----------------------- |
139
- | `xs` | 12px | Small labels, captions |
140
- | `sm` | 14px | Body text, descriptions |
141
- | `md` | 16px | Default text size |
142
- | `lg` | 18px | Slightly larger text |
143
- | `xl` | 20px | Subheadings |
144
- | `2xl` | 24px | Headings |
145
- | `3xl` | 30px | Large headings |
146
- | `4xl` | 36px | Hero text |
147
- | `5xl` | 48px | Display text |
148
- | `6xl` | 60px | Giant display text |
137
+ | Token | Pixels | Use Case |
138
+ | ------ | ------ | ----------------------- |
139
+ | `xs` | 12px | Small labels, captions |
140
+ | `sm` | 14px | Body text, descriptions |
141
+ | `base` | 16px | Default text size |
142
+ | `lg` | 18px | Slightly larger text |
143
+ | `xl` | 20px | Subheadings |
144
+ | `2xl` | 24px | Headings |
145
+ | `3xl` | 30px | Large headings |
146
+ | `4xl` | 36px | Hero text |
147
+ | `5xl` | 48px | Display text |
148
+ | `6xl` | 60px | Giant display text |
149
149
 
150
150
  ---
151
151
 
@@ -213,33 +213,26 @@ ThemeManager.init(gameTheme);
213
213
  ### 🎯 **Using Theme Tokens**
214
214
 
215
215
  ```typescript
216
- import {
217
- ColorPicker,
218
- FontPicker,
219
- SpacingPicker,
220
- TypographyPicker,
221
- EffectPicker,
222
- } from 'phaser-wind';
216
+ import { Color, Font, FontSize, Spacing, ThemeManager } from 'phaser-wind';
223
217
 
224
218
  // Colors - automatically looks in colors.*
225
- const primaryColor = ColorPicker.rgb('primary'); // Gets colors.primary
226
- const uiBackground = ColorPicker.hex('ui-background'); // Gets colors.ui-background
219
+ const primaryColor = Color.rgb('primary'); // Gets colors.primary
220
+ const uiBackground = Color.hex('ui-background'); // Gets colors.ui-background
227
221
 
228
222
  // Fonts
229
- const displayFont = FontPicker.family('display'); // Gets fonts.display
230
- const primaryFont = FontPicker.family('primary'); // Gets fonts.primary
223
+ const displayFont = Font.family('display'); // Gets fonts.display
224
+ const primaryFont = Font.family('primary'); // Gets fonts.primary
231
225
 
232
226
  // Spacing
233
- const mediumSpace = SpacingPicker.px('md'); // Gets spacing.md (16px)
234
- const largeSpace = SpacingPicker.px('lg'); // Gets spacing.lg (24px)
235
-
236
- // Complete typography styles
237
- const headingStyle = TypographyPicker.phaserStyle('heading');
238
- // Returns: { fontSize: '24px', fontFamily: 'Orbitron, monospace', fontStyle: 'bold' }
239
-
240
- // Effects
241
- const glowConfig = EffectPicker.config('glow-primary');
242
- // Returns: { blur: 8, color: 'purple-600', alpha: 0.6 }
227
+ const mediumSpace = Spacing.px('md'); // Gets spacing.md (16px)
228
+ const largeSpace = Spacing.px('lg'); // Gets spacing.lg (24px)
229
+
230
+ // Complete typography styles - using basic components for now
231
+ const headingStyle = {
232
+ fontSize: FontSize.css('2xl'),
233
+ fontFamily: Font.family('display'),
234
+ fontWeight: 'bold',
235
+ };
243
236
 
244
237
  // Custom tokens
245
238
  const animDuration = ThemeManager.getToken('animations.duration'); // 300
@@ -272,23 +265,23 @@ const themes = ThemeManager.getRegisteredThemes(); // ['light', 'dark', 'cyberpu
272
265
  export class GameScene extends Phaser.Scene {
273
266
  create() {
274
267
  // Player health bar with theme colors
275
- const healthWidth = SpacingPicker.px('massive'); // 96px
276
- const healthHeight = SpacingPicker.px('md'); // 16px
268
+ const healthWidth = Spacing.px('24'); // 96px
269
+ const healthHeight = Spacing.px('4'); // 16px
277
270
 
278
271
  this.add.rectangle(
279
272
  50,
280
273
  50,
281
274
  healthWidth,
282
275
  healthHeight,
283
- ColorPicker.hex('player-health')
276
+ Color.hex('player-health')
284
277
  ); // Green from theme
285
278
 
286
279
  // Game title with theme typography
287
- const titleStyle = TypographyPicker.phaserStyle('heading');
288
280
  this.add
289
281
  .text(400, 50, 'CYBER QUEST', {
290
- ...titleStyle,
291
- color: ColorPicker.rgb('primary'), // Purple from theme
282
+ fontSize: FontSize.css('4xl'),
283
+ fontFamily: Font.family('display'),
284
+ color: Color.rgb('primary'), // Purple from theme
292
285
  })
293
286
  .setOrigin(0.5);
294
287
 
@@ -297,8 +290,8 @@ export class GameScene extends Phaser.Scene {
297
290
  400,
298
291
  400,
299
292
  'START GAME',
300
- SpacingPicker.px('huge'), // 64px width
301
- SpacingPicker.px('lg') // 24px height
293
+ Spacing.px('16'), // 64px width
294
+ Spacing.px('6') // 24px height
302
295
  );
303
296
  }
304
297
 
@@ -310,20 +303,16 @@ export class GameScene extends Phaser.Scene {
310
303
  height: number
311
304
  ) {
312
305
  const button = this.add
313
- .rectangle(x, y, width, height, ColorPicker.hex('ui-background'))
306
+ .rectangle(x, y, width, height, Color.hex('ui-background'))
314
307
  .setInteractive()
315
- .on('pointerover', () =>
316
- button.setFillStyle(ColorPicker.hex('secondary'))
317
- )
318
- .on('pointerout', () =>
319
- button.setFillStyle(ColorPicker.hex('ui-background'))
320
- );
321
-
322
- const buttonText = TypographyPicker.phaserStyle('body');
308
+ .on('pointerover', () => button.setFillStyle(Color.hex('secondary')))
309
+ .on('pointerout', () => button.setFillStyle(Color.hex('ui-background')));
310
+
323
311
  this.add
324
312
  .text(x, y, text, {
325
- ...buttonText,
326
- color: ColorPicker.rgb('primary'),
313
+ fontSize: FontSize.css('base'),
314
+ fontFamily: Font.family('primary'),
315
+ color: Color.rgb('primary'),
327
316
  })
328
317
  .setOrigin(0.5);
329
318
  }
@@ -382,50 +371,50 @@ const theme = createTheme({
382
371
  ### Game UI Components
383
372
 
384
373
  ```typescript
385
- import { ColorPicker, FontSizePicker } from 'phaser-wind';
374
+ import { Color, FontSize } from 'phaser-wind';
386
375
 
387
376
  export class GameScene extends Phaser.Scene {
388
377
  create() {
389
378
  // Main title
390
379
  this.add
391
380
  .text(400, 100, 'SPACE RAIDERS', {
392
- fontSize: FontSizePicker.css('5xl'),
393
- fill: ColorPicker.rgb('yellow-400'),
394
- stroke: ColorPicker.rgb('yellow-800'),
381
+ fontSize: FontSize.css('5xl'),
382
+ fill: Color.rgb('yellow-400'),
383
+ stroke: Color.rgb('yellow-800'),
395
384
  strokeThickness: 2,
396
385
  })
397
386
  .setOrigin(0.5);
398
387
 
399
388
  // Score display
400
389
  this.add.text(50, 50, 'Score: 12,500', {
401
- fontSize: FontSizePicker.css('xl'),
402
- fill: ColorPicker.rgb('green-400'),
390
+ fontSize: FontSize.css('xl'),
391
+ fill: Color.rgb('green-400'),
403
392
  });
404
393
 
405
394
  // Health bar background
406
395
  const healthBg = this.add.graphics();
407
- healthBg.fillStyle(ColorPicker.hex('red-900'));
396
+ healthBg.fillStyle(Color.hex('red-900'));
408
397
  healthBg.fillRect(50, 100, 200, 20);
409
398
 
410
399
  // Health bar fill
411
400
  const healthFill = this.add.graphics();
412
- healthFill.fillStyle(ColorPicker.hex('red-500'));
401
+ healthFill.fillStyle(Color.hex('red-500'));
413
402
  healthFill.fillRect(52, 102, 156, 16); // 80% health
414
403
 
415
404
  // Game over screen
416
- this.add.rectangle(400, 300, 600, 400, ColorPicker.hex('slate-900'), 0.9);
405
+ this.add.rectangle(400, 300, 600, 400, Color.hex('slate-900'), 0.9);
417
406
 
418
407
  this.add
419
408
  .text(400, 250, 'GAME OVER', {
420
- fontSize: FontSizePicker.css('4xl'),
421
- fill: ColorPicker.rgb('red-500'),
409
+ fontSize: FontSize.css('4xl'),
410
+ fill: Color.rgb('red-500'),
422
411
  })
423
412
  .setOrigin(0.5);
424
413
 
425
414
  this.add
426
415
  .text(400, 320, 'Final Score: 12,500', {
427
- fontSize: FontSizePicker.css('2xl'),
428
- fill: ColorPicker.rgb('slate-300'),
416
+ fontSize: FontSize.css('2xl'),
417
+ fill: Color.rgb('slate-300'),
429
418
  })
430
419
  .setOrigin(0.5);
431
420
  }
@@ -445,19 +434,19 @@ class GameButton {
445
434
  ) {
446
435
  const colors = {
447
436
  primary: {
448
- bg: ColorPicker.hex('blue-600'),
449
- bgHover: ColorPicker.hex('blue-700'),
450
- text: ColorPicker.rgb('white'),
437
+ bg: Color.hex('blue-600'),
438
+ bgHover: Color.hex('blue-700'),
439
+ text: Color.rgb('white'),
451
440
  },
452
441
  secondary: {
453
- bg: ColorPicker.hex('slate-600'),
454
- bgHover: ColorPicker.hex('slate-700'),
455
- text: ColorPicker.rgb('slate-100'),
442
+ bg: Color.hex('slate-600'),
443
+ bgHover: Color.hex('slate-700'),
444
+ text: Color.rgb('slate-100'),
456
445
  },
457
446
  danger: {
458
- bg: ColorPicker.hex('red-600'),
459
- bgHover: ColorPicker.hex('red-700'),
460
- text: ColorPicker.rgb('white'),
447
+ bg: Color.hex('red-600'),
448
+ bgHover: Color.hex('red-700'),
449
+ text: Color.rgb('white'),
461
450
  },
462
451
  };
463
452
 
@@ -473,7 +462,7 @@ class GameButton {
473
462
  // Text
474
463
  this.text = scene.add
475
464
  .text(x, y, text, {
476
- fontSize: FontSizePicker.css('lg'),
465
+ fontSize: FontSize.css('lg'),
477
466
  fill: style.text,
478
467
  })
479
468
  .setOrigin(0.5);
@@ -493,11 +482,11 @@ const quitButton = new GameButton(this, 400, 360, 'QUIT', 'danger');
493
482
  this.add.particles(player.x, player.y, 'sparkle', {
494
483
  speed: { min: 50, max: 100 },
495
484
  tint: [
496
- ColorPicker.hex('blue-400'),
497
- ColorPicker.hex('blue-500'),
498
- ColorPicker.hex('blue-600'),
499
- ColorPicker.hex('cyan-400'),
500
- ColorPicker.hex('cyan-500'),
485
+ Color.hex('blue-400'),
486
+ Color.hex('blue-500'),
487
+ Color.hex('blue-600'),
488
+ Color.hex('cyan-400'),
489
+ Color.hex('cyan-500'),
501
490
  ],
502
491
  lifespan: 1000,
503
492
  });
@@ -510,7 +499,7 @@ this.add.particles(player.x, player.y, 'sparkle', {
510
499
  ### Scene Setup
511
500
 
512
501
  ```typescript
513
- import { ColorPicker, FontSizePicker } from 'phaser-wind';
502
+ import { Color, FontSize } from 'phaser-wind';
514
503
 
515
504
  export class MenuScene extends Phaser.Scene {
516
505
  constructor() {
@@ -521,10 +510,10 @@ export class MenuScene extends Phaser.Scene {
521
510
  // Background gradient effect
522
511
  const bg = this.add.graphics();
523
512
  bg.fillGradientStyle(
524
- ColorPicker.hex('slate-900'), // top-left
525
- ColorPicker.hex('slate-800'), // top-right
526
- ColorPicker.hex('slate-800'), // bottom-left
527
- ColorPicker.hex('slate-700') // bottom-right
513
+ Color.hex('slate-900'), // top-left
514
+ Color.hex('slate-800'), // top-right
515
+ Color.hex('slate-800'), // bottom-left
516
+ Color.hex('slate-700') // bottom-right
528
517
  );
529
518
  bg.fillRect(0, 0, this.cameras.main.width, this.cameras.main.height);
530
519
 
@@ -536,9 +525,9 @@ export class MenuScene extends Phaser.Scene {
536
525
  private createTitle() {
537
526
  this.add
538
527
  .text(this.cameras.main.centerX, 150, 'MY AWESOME GAME', {
539
- fontSize: FontSizePicker.css('4xl'),
540
- fill: ColorPicker.rgb('yellow-400'),
541
- stroke: ColorPicker.rgb('yellow-700'),
528
+ fontSize: FontSize.css('4xl'),
529
+ fill: Color.rgb('yellow-400'),
530
+ stroke: Color.rgb('yellow-700'),
542
531
  strokeThickness: 3,
543
532
  })
544
533
  .setOrigin(0.5);
@@ -550,13 +539,13 @@ export class MenuScene extends Phaser.Scene {
550
539
  menuItems.forEach((item, index) => {
551
540
  this.add
552
541
  .text(this.cameras.main.centerX, 250 + index * 60, item, {
553
- fontSize: FontSizePicker.css('xl'),
554
- fill: ColorPicker.rgb('slate-300'),
542
+ fontSize: FontSize.css('xl'),
543
+ fill: Color.rgb('slate-300'),
555
544
  })
556
545
  .setOrigin(0.5)
557
546
  .setInteractive()
558
547
  .on('pointerover', function () {
559
- this.setTint(ColorPicker.hex('yellow-400'));
548
+ this.setTint(Color.hex('yellow-400'));
560
549
  })
561
550
  .on('pointerout', function () {
562
551
  this.clearTint();
@@ -575,21 +564,21 @@ export class MenuScene extends Phaser.Scene {
575
564
  ```typescript
576
565
  // Create consistent themes
577
566
  const darkTheme = {
578
- background: ColorPicker.hex('slate-900'),
579
- surface: ColorPicker.hex('slate-800'),
580
- primary: ColorPicker.hex('blue-500'),
581
- secondary: ColorPicker.hex('slate-600'),
582
- text: ColorPicker.rgb('slate-100'),
583
- textMuted: ColorPicker.rgb('slate-400'),
567
+ background: Color.hex('slate-900'),
568
+ surface: Color.hex('slate-800'),
569
+ primary: Color.hex('blue-500'),
570
+ secondary: Color.hex('slate-600'),
571
+ text: Color.rgb('slate-100'),
572
+ textMuted: Color.rgb('slate-400'),
584
573
  };
585
574
 
586
575
  const lightTheme = {
587
- background: ColorPicker.hex('slate-50'),
588
- surface: ColorPicker.hex('white'),
589
- primary: ColorPicker.hex('blue-600'),
590
- secondary: ColorPicker.hex('slate-200'),
591
- text: ColorPicker.rgb('slate-900'),
592
- textMuted: ColorPicker.rgb('slate-600'),
576
+ background: Color.hex('slate-50'),
577
+ surface: Color.hex('white'),
578
+ primary: Color.hex('blue-600'),
579
+ secondary: Color.hex('slate-200'),
580
+ text: Color.rgb('slate-900'),
581
+ textMuted: Color.rgb('slate-600'),
593
582
  };
594
583
  ```
595
584
 
@@ -599,13 +588,13 @@ const lightTheme = {
599
588
  // Scale text based on screen size
600
589
  const getResponsiveTextSize = (baseSize: FontSizeKey): string => {
601
590
  const scale = this.cameras.main.width / 1920; // Base on 1920px width
602
- const basePixels = FontSizePicker.px(baseSize);
591
+ const basePixels = FontSize.px(baseSize);
603
592
  return `${Math.round(basePixels * scale)}px`;
604
593
  };
605
594
 
606
595
  this.add.text(x, y, 'Responsive Text', {
607
596
  fontSize: getResponsiveTextSize('2xl'),
608
- fill: ColorPicker.rgb('blue-500'),
597
+ fill: Color.rgb('blue-500'),
609
598
  });
610
599
  ```
611
600
 
@@ -625,16 +614,16 @@ Plus, `phaser-wind` is way easier to type than `phaser-tailwind-css-design-token
625
614
 
626
615
  ## 📚 Compared to Raw Phaser
627
616
 
628
- | Without Phaser Wind | With Phaser Wind |
629
- | ------------------------ | ------------------------------------- |
630
- | `fill: '#3B82F6'` | `fill: ColorPicker.rgb('primary')` |
631
- | `fontSize: '18px'` | `fontSize: FontSizePicker.css('lg')` |
632
- | `tint: 0x4ADE80` | `tint: ColorPicker.hex('success')` |
633
- | `fontFamily: 'Arial'` | `fontFamily: FontPicker.family('ui')` |
634
- | Magic numbers everywhere | Semantic, consistent tokens |
635
- | Color picking hell | Harmonious color palettes |
636
- | Inconsistent sizing | Perfect typography scale |
637
- | No design system | Complete theme architecture |
617
+ | Without Phaser Wind | With Phaser Wind |
618
+ | ------------------------ | ------------------------------- |
619
+ | `fill: '#3B82F6'` | `fill: Color.rgb('primary')` |
620
+ | `fontSize: '18px'` | `fontSize: FontSize.css('lg')` |
621
+ | `tint: 0x4ADE80` | `tint: Color.hex('success')` |
622
+ | `fontFamily: 'Arial'` | `fontFamily: Font.family('ui')` |
623
+ | Magic numbers everywhere | Semantic, consistent tokens |
624
+ | Color picking hell | Harmonious color palettes |
625
+ | Inconsistent sizing | Perfect typography scale |
626
+ | No design system | Complete theme architecture |
638
627
 
639
628
  ---
640
629