Skip to content

Conversation

@sparr
Copy link

@sparr sparr commented Nov 23, 2025

Brief Description

This PR restricts color strings (color, fill. stroke, etc) to starting with "#". Unfortunately there's no performant way to narrow it down to just hex characters (requires a monstrous union type) or the correct length (requires recursive types or other tricks).

Added one new test line with a bad color.

Checklists

  • Test passed
  • Coding style (indentation, etc)
  • Edits have been made to src/ files not index.d.ts
  • Run npm run compile to update index.d.ts

@RiftLurker
Copy link
Contributor

Color strings allow for a lot more options than just RGB strings prefixed with a #.

@sparr
Copy link
Author

sparr commented Nov 26, 2025

I see from the official docs that the game drawing functions accept "any web format" for fill/stroke/etc colors. Thanks for pointing me in that direction; I had no idea.

@sparr sparr closed this Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants