code: private function createConditionsForPalette(PaletteInterface $palette, array $typeLegends)
      {
          $conditions = [];
  
          foreach ($typeLegends as $value => $legends) {
              // We use an immutable implementation. Using the same condition is save here.
              $valueCondition = new FilterSettingTypeSubPaletteCondition($this->filterFactory, $value);
  
              foreach ($legends as $legendName => $legendProperties) {
                  $legend = $this->getLegend($palette, $legendName);
  
                  foreach ($legendProperties as $propertyName) {
                      $this
                          ->getConditionChain($legend, $propertyName, $conditions)
                          ->addCondition($valueCondition);
                  }
              }
          }
      }
docs: Create all conditions for the given palette.
  
  @param PaletteInterface $palette     The palette.
  @param array            $typeLegends The type legends.
  
  @return void