@@ -264,7 +264,7 @@ open class BuildThemes : DefaultTask() {
264264 constructableLookAndFeel,
265265 initialParentTemplateName,
266266 ),
267- icons = getIcons(resolvedNamedColors, constructableLookAndFeel),
267+ icons = getIcons(resolvedNamedColors, constructableLookAndFeel, initialParentTemplateName ),
268268 meta = masterThemeDefinition.meta ? : Collections .emptyMap()
269269 )
270270
@@ -425,12 +425,22 @@ open class BuildThemes : DefaultTask() {
425425 @Suppress(" UNCHECKED_CAST" )
426426 private fun getIcons (
427427 colors : Map <String , String >,
428- constructableAsset : ConstructableAsset
428+ constructableAsset : ConstructableAsset ,
429+ initialParentTemplateName : String
429430 ): Map <String , Any > {
430431 val template = constructableAsset.definitions[" base" ]
431432 ? : throw IllegalArgumentException (" Expected constructable type '${constructableAsset.type} ' to have type 'base'!" )
433+ val parentTemplate = constructableAsset.definitions[initialParentTemplateName]
434+ ? : throw IllegalArgumentException (" Expected constructable type '${constructableAsset.type} ' to have type '${initialParentTemplateName} '!" )
435+ val parentIcons = template.icons?.toMutableMap() ? : mutableMapOf ()
436+ val childIcons = parentTemplate.icons?.toMutableMap() ? : mutableMapOf ()
437+ val combinedPalette = combineMaps(
438+ (parentIcons[" ColorPalette" ] ? : emptyMap<String , String >()) as StringDictionary <Any >,
439+ (childIcons[" ColorPalette" ] ? : emptyMap<String , String >()) as StringDictionary <Any >
440+ )
441+ parentIcons[" ColorPalette" ] = combinedPalette
432442 return resolveNamedColorsForMap(
433- template.icons ? : emptyMap() ,
443+ parentIcons ,
434444 colors,
435445 )
436446 }
0 commit comments