| | <!-- |
| | | Prevent similar adjacent colours. |
| | - | http://math.stackexchange.com/a/936767/7932 |
| | + | |
| | + | wi = wedge index number |
| | + | wt = total number of wedges |
| | + | wte = evenness determiniate for wt |
| | + | |
| | + | http://math.stackexchange.com/a/936276/7932 |
| | +--> |
| | <xsl:variable name="wi" select="$wedge"/> |
| | <xsl:variable name="wt" select="$wedges"/> |
| | - <xsl:variable name="w"> |
| | - <xsl:choose> |
| | - <xsl:when test="$wt > 5"> |
| | - <xsl:variable name="weven" select="(($wi+4) mod ($wt + $wt mod 2))"/> |
| | - <xsl:value-of |
| | - select="$weven * (1-($wi mod 2)) + ($wi mod 2 * $wi)"/> |
| | - </xsl:when> |
| | - <xsl:otherwise> |
| | - <xsl:value-of select="$wedge"/> |
| | - </xsl:otherwise> |
| | - </xsl:choose> |
| | - </xsl:variable> |
| | + <xsl:variable name="wte" select="$wt + (1 - ($wt mod 2))"/> |
| | + |
| | + <xsl:variable name="w" select=" |
| | + round(($wi - ($wt mod 2)) * |
| | + floor( $wt div 2 ) mod $wte) + |
| | + ($wt mod 2)"/> |
| | |
| | <!-- lch_l, lch_c, and lch_h are now set; rotate the hue. --> |