AtomMaterialUI / color-highlighter

JetBrains plugin to preview colors directly from within the code.
MIT License
40 stars 23 forks source link

More flexible RGB parsing #129

Closed OndrejSpanel closed 10 months ago

OndrejSpanel commented 10 months ago

Description

Motivation and Context

Currently sources with unexpected or wrong values in Color constructors cause the plugin to throw. This is not nice, even wrong sources should be handled gracefully. This does not happen - parsing is always wrapped with try at the top level.

Instead this PR makes parsing more robust against various combinations of int, float and double parameters. This is most likely not relevant for Java or Kotlin, where Int is not convertible to Float, but can be useful in other languages (Scala) and should make the RGB parser more universal and reusable.

Types of changes

Checklist:

OndrejSpanel commented 10 months ago

I want to add smarter auto-detection of mixed float (or double) / int inputs.

stale[bot] commented 10 months ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mallowigi commented 10 months ago

Tell me whenever you're ready. I merged the other one.

OndrejSpanel commented 10 months ago

I think it should be ready. For future development, some unit test would probably come handy - perhaps I will find some time to add some, but I do not think this PR needs to wait for them.

stale[bot] commented 10 months ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.