protected function getShapes($colorTheme, $hash)
    {
        $usedColorThemeIndexes = array();
        $categories = self::getCategories();
        $shapes = array();
        $colorCount = $colorTheme->getCount();
        
        foreach ($categories as $category) {
            $colorThemeIndex = 
                self::getOctet($hash, $category->colorIndex) % $colorCount;

            if (self::isDuplicate(
                    // Disallow dark gray and dark color combo
                    $usedColorThemeIndexes, $colorThemeIndex, array(0, 4)) || 
                self::isDuplicate(
                    // Disallow light gray and light color combo
                    $usedColorThemeIndexes, $colorThemeIndex, array(2, 3))
            ) {
                $colorThemeIndex = 1;
            }

            $usedColorThemeIndexes[] = $colorThemeIndex;

            $startRotationIndex = $category->rotationIndex === null ? 
                0 : self::getOctet($hash, $category->rotationIndex);
            $shapeIndex = 
                self::getOctet($hash, $category->shapeIndex) % 
                count($category->shapes);
            $shape = $category->shapes[$shapeIndex];
            
            $shapes[] = new Shape(
                /*$definition=*/ $shape,
                /*$color=*/ $colorTheme->getByIndex($colorThemeIndex),
                /*$positions=*/ $category->positions,
                /*$startRotationIndex=*/ $startRotationIndex
            );
        }
        
        return $shapes;
    }
protected function getShapes($colorTheme, $hash)
    {
        $usedColorThemeIndexes = array();
        $categories = self::getCategories();
        $shapes = array();
        $colorCount = $colorTheme->getCount();
        
        foreach ($categories as $category) {
            $colorThemeIndex = 
                self::getOctet($hash, $category->colorIndex) % $colorCount;

            if (self::isDuplicate(
                    // Disallow dark gray and dark color combo
                    $usedColorThemeIndexes, $colorThemeIndex, array(0, 4)) || 
                self::isDuplicate(
                    // Disallow light gray and light color combo
                    $usedColorThemeIndexes, $colorThemeIndex, array(2, 3))
            ) {
                $colorThemeIndex = 1;
            }

            $usedColorThemeIndexes[] = $colorThemeIndex;

            $startRotationIndex = $category->rotationIndex === null ? 
                0 : self::getOctet($hash, $category->rotationIndex);
            $shapeIndex = 
                self::getOctet($hash, $category->shapeIndex) % 
                count($category->shapes);
            $shape = $category->shapes[$shapeIndex];
            
            $shapes[] = new Shape(
                /*$definition=*/ $shape,
                /*$color=*/ $colorTheme->getByIndex($colorThemeIndex),
                /*$positions=*/ $category->positions,
                /*$startRotationIndex=*/ $startRotationIndex
            );
        }
        
        return $shapes;
    }
protected function getShapes ( $ colorTheme , $ hash ) { $ usedColorThemeIndexes = array ( ) ; $ categories = self :: getCategories ( ) ; $ shapes = array ( ) ; $ colorCount = $ colorTheme -> getCount ( ) ; foreach ( $ categories as $ category ) { $ colorThemeIndex = self :: getOctet ( $ hash , $ category -> colorIndex ) % $ colorCount ; if ( self :: isDuplicate ( // Disallow dark gray and dark color combo $ usedColorThemeIndexes , $ colorThemeIndex , array ( 0 , 4 ) ) || self :: isDuplicate ( // Disallow light gray and light color combo $ usedColorThemeIndexes , $ colorThemeIndex , array ( 2 , 3 ) ) ) { $ colorThemeIndex = 1 ; } $ usedColorThemeIndexes [ ] = $ colorThemeIndex ; $ startRotationIndex = $ category -> rotationIndex === null ? 0 : self :: getOctet ( $ hash , $ category -> rotationIndex ) ; $ shapeIndex = self :: getOctet ( $ hash , $ category -> shapeIndex ) % count ( $ category -> shapes ) ; $ shape = $ category -> shapes [ $ shapeIndex ] ; $ shapes [ ] = new Shape ( /*$definition=*/ $ shape , /*$color=*/ $ colorTheme -> getByIndex ( $ colorThemeIndex ) , /*$positions=*/ $ category -> positions , /*$startRotationIndex=*/ $ startRotationIndex ) ; } return $ shapes ; }
Gets an enumeration of individual shapes to be rendered in an icon for a
specific hash.

@param \Jdenticon\Rendering\ColorTheme $colorTheme A color theme
specifying the colors to be used in the icon.
@param string $hash The hash for which the shapes will be returned.
@return array(Jdenticon\Shapes\Shape)
Gets an enumeration of individual shapes to be rendered in an icon for a specific hash .