@@ -418,18 +418,22 @@ const std::string getStopColor(SBMLDocument* document, unsigned int renderIndex,
418418}
419419
420420int setStopColor (SBMLDocument* document, const std::string& sid, const std::string& stopColor) {
421+ addColor (getGlobalRenderInformation (document), stopColor);
421422 return setStopColor (getGradientDefinition (document, sid), stopColor);
422423}
423424
424425int setStopColor (SBMLDocument* document, unsigned int renderIndex, const std::string& sid, const std::string& stopColor) {
426+ addColor (getGlobalRenderInformation (document, renderIndex), stopColor);
425427 return setStopColor (getGradientDefinition (document, renderIndex, sid), stopColor);
426428}
427429
428430int setStopColor (SBMLDocument* document, const std::string& sid, unsigned int gradientStopIndex, const std::string& stopColor) {
431+ addColor (getGlobalRenderInformation (document), stopColor);
429432 return setStopColor (getGradientDefinition (document, sid), gradientStopIndex, stopColor);
430433}
431434
432435int setStopColor (SBMLDocument* document, unsigned int renderIndex, const std::string& sid, unsigned int gradientStopIndex, const std::string& stopColor) {
436+ addColor (getGlobalRenderInformation (document, renderIndex), stopColor);
433437 return setStopColor (getGradientDefinition (document, renderIndex, sid), gradientStopIndex, stopColor);
434438}
435439
@@ -3782,6 +3786,7 @@ int setFillColor(SBMLDocument* document, GraphicalObject* graphicalObject, const
37823786 Style* style = getLocalStyle (document, graphicalObject);
37833787 if (!style)
37843788 style = createLocalStyle (document, graphicalObject);
3789+ addColor (document, style, fillColor);
37853790 if (getNumGeometricShapes (style) == 1 && isSetFillColor (getGeometricShape (style)))
37863791 return setFillColor (getGeometricShape (style), fillColor);
37873792
@@ -3796,6 +3801,7 @@ int setFillColor(SBMLDocument* document, const std::string& attribute, const std
37963801 Style* style = getLocalStyle (document, attribute);
37973802 if (!style)
37983803 style = createLocalStyle (document, attribute);
3804+ addColor (document, style, fillColor);
37993805 if (getNumGeometricShapes (style) == 1 && isSetFillColor (getGeometricShape (style)))
38003806 return setFillColor (getGeometricShape (style), fillColor);
38013807
0 commit comments