Make the processing of background from children being passed to parent better.
Instead of just being passed from the last child, the condition is: the child that ocupies the biggest area of the parent AND has this area be at least 90% of the parent is the one who will pass its backgroundColor for the parent. If no child completes these requisites, the parent will retain its backgroundColor.