diff --git a/lib/network/modules/components/Node.js b/lib/network/modules/components/Node.js index 828d5c3f..f8780908 100644 --- a/lib/network/modules/components/Node.js +++ b/lib/network/modules/components/Node.js @@ -212,8 +212,12 @@ class Node { var groupObj = groupList.get(group); // Skip merging of group font options into parent; these are required to be distinct for labels - // TODO: It might not be a good idea either to merge the rest of the options, investigate this. - util.selectiveNotDeepExtend(['font'], parentOptions, groupObj); + // Also skip mergin of color IF it is already defined in the node itself. This is to avoid the color of the + // group overriding the color set at the node level + // TODO: It might not be a good idea either to merge the rest of the options, investigate this. + var skipProperties = ['font']; + if (newOptions !== undefined && newOptions.color !== undefined && newOptions.color != null) skipProperties.push('color'); + util.selectiveNotDeepExtend(skipProperties, parentOptions, groupObj); // the color object needs to be completely defined. // Since groups can partially overwrite the colors, we parse it again, just in case.