How to Check If Color String Valid
|
We have a project based on ReactNative. Recently, we encountered a problem, that is, when the operation colleague configured the color value, one was missing, and only five were allocated, which led to page confusion and JS errors.
In addition to increasing restrictions on the configuration platform, we have also taken some inspection measures in the project.
The problem is, how to check if the color string is valid using JS.