pattern.c
void vCrossfade( int16_t start, uint16_t len, uint8_t ramp, uint8_t R, uint8_t G, uint8_t B )
{
    uint32_t counter = 0;
    if( ramp )
    {
        /* Iterate from the end to the start. */
        for( int16_t i = start; i > start - len; i-- )
        {
            vSetLed(i,
                   ucGetLed(i, RED) * counter / len + R * ( len - counter ) / len,
                   ucGetLed(i, GRN) * counter / len + G * ( len - counter ) / len,
                   ucGetLed(i, BLU) * counter / len + B * ( len - counter ) / len);
            counter++;
        }
    }
    else
    {
        /* Iterate from the start to the end. */
        for( int16_t i = start; i < ( start + len ); i++ )
        {
            vSetLed(i,
                   ucGetLed(i, RED) * counter / len + R * ( len - counter ) / len,
                   ucGetLed(i, GRN) * counter / len + G * ( len - counter ) / len,
                   ucGetLed(i, BLU) * counter / len + B * ( len - counter ) / len);
            counter++;
        }
    }
}
/**
  * @brief  Crossfades between the RGB colors.
  * @note
        If ramp then go from end of strip to start of strip
        Else then go from start of strip to end of strip
  * @retval None
  */
@brief  Crossfades between the RGB colors.
@note
If ramp then go from end of strip to start of strip
Else then go from start of strip to end of strip
@retval None
@brief Crossfades between the RGB colors . @note If ramp then go from end of strip to start of strip Else then go from start of strip to end of strip @retval None
void vCrossfade( int16_t start, uint16_t len, uint8_t ramp, uint8_t R, uint8_t G, uint8_t B )
{
    uint32_t counter = 0;
    if( ramp )
    {
        for( int16_t i = start; i > start - len; i-- )
        {
            vSetLed(i,
                   ucGetLed(i, RED) * counter / len + R * ( len - counter ) / len,
                   ucGetLed(i, GRN) * counter / len + G * ( len - counter ) / len,
                   ucGetLed(i, BLU) * counter / len + B * ( len - counter ) / len);
            counter++;
        }
    }
    else
    {
        for( int16_t i = start; i < ( start + len ); i++ )
        {
            vSetLed(i,
                   ucGetLed(i, RED) * counter / len + R * ( len - counter ) / len,
                   ucGetLed(i, GRN) * counter / len + G * ( len - counter ) / len,
                   ucGetLed(i, BLU) * counter / len + B * ( len - counter ) / len);
            counter++;
        }
    }
}
void vCrossfade ( int16_t start , uint16_t len , uint8_t ramp , uint8_t R , uint8_t G , uint8_t B ) { uint32_t counter = 0 ; if ( ramp ) { for ( int16_t i = start ; i > start - len ; i -- ) { vSetLed ( i , ucGetLed ( i , RED ) * counter / len + R * ( len - counter ) / len , ucGetLed ( i , GRN ) * counter / len + G * ( len - counter ) / len , ucGetLed ( i , BLU ) * counter / len + B * ( len - counter ) / len ) ; counter ++ ; } } else { for ( int16_t i = start ; i < ( start + len ) ; i ++ ) { vSetLed ( i , ucGetLed ( i , RED ) * counter / len + R * ( len - counter ) / len , ucGetLed ( i , GRN ) * counter / len + G * ( len - counter ) / len , ucGetLed ( i , BLU ) * counter / len + B * ( len - counter ) / len ) ; counter ++ ; } } }
@brief  Crossfades between the RGB colors.
@brief Crossfades between the RGB colors .
/* Iterate from the end to the start. */ /* Iterate from the start to the end. */