fromCssColorString crashes system

So, we are experiencing a weird issue with using colors generated with fromCssColorString. We have a subscription system written in javascript using html5 sockets to receive data from our internal software. We want our users to be able to interact with the map and our admins to be able to see and differentiate some of the things our users do to the map such as putting a way point on the map. We even set up a function to grab the extents of each user and draw a rectangle per user looking at the map with the rectangle being the size of the extents that a user is looking at in real time.
Now here comes the actual issue. When color coding these items, we subscribe to that users color from our internal software (which comes in as a hex value) or we use an rgba css color string. Using either of these has caused Cesium to crash. The error we get when crashing is as follows:

An error occurred while rendering. Rendering has stopped.
undefined
TypeError: undefined is not a function
TypeError: undefined is not a function
    at StaticOutlineGeometryBatch.remove (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:88237:36)
    at removeUpdater (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:88416:24)
    at GeometryVisualizer.update (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:88522:13)
    at DataSourceDisplay.update (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:101660:37)
    at Viewer._onTick (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:154332:49)
    at Event.raiseEvent (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:4523:30)
    at Clock.tick (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:31544:21)
    at CesiumWidget.render (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:149145:39)
    at render (http://localhost/oars/lib/Cesium-1.7/CesiumUnminified/Cesium.js:148582:32)

So, this does not happen the instant we put one color in. It seems to occur once we have multiple colors in the system. We are using these colors with multiple entities. Our bounding box is using the entity.rectangle while our way points are using an entity.circle with an entity.ellipse to generate the look we want. The way points are set in place but when a user has more than one way point generated, we draw a polyline between the points in the order they were put on the page. The bounding boxes that we have using the entity.rectangle are able to move because they are connected with the users real time movements. We also have other objects moving on the page based on the internal software.

Basically, it seems like once you have a certain amount of entities on the map using colors generated from the fromCssColorString the map crashes. If I use a Cesium preset color such as Cesium.Color.RED then the error stops occurring so we know the problem isn't with how we are generating our entities or putting them on the map.

Has anyone else seen this issue or have a suggestion on how to get around it? We have considered parsing our rgba strings so we can do a new Cesium.Color(red, green, blue, alpha) but one would think the fromCssColorString should be doing that already.

It looks like fromCssColorString is returning undefined if the color is invalid, which is causing you to assign undefined to the color property, which ends up leading to the crash. There are two issues here

  1. On our end, we should probably change the Cesium code to not return undefined but instead throw an Exception. This doesn’t fix your problem, but it would have made this error more clear.

  2. At some point in your code, you are providing Cesium a CSS color string that is either invalid, or exposes a bug in fromCssColorString that causes it to return undefined.

In either case, the solution is simple. In your code, whenever you are calling fromCssColorString, add an if check to see if the result is undefined, if it is undefined, log the string to the console and use a default color. Report back what the logged strings are and we can determine if it’s invalid CSS or an error in fromCssColorString.