lib/generator.js
function getRandomLetterColor() {
    // Reset index if we're at the end of the array
    if (currentColorIndex >= colorKeys.length) {
        currentColorIndex = 0;
    }
    
    // Get current color and increment index for next time
    var currentColorKey = colorKeys[currentColorIndex++];
    
    // Return most satured color hex (a700 or 900)
    var color = colors[currentColorKey]['a700'] || colors[currentColorKey]['900'];
    
    // Invalid color saturation value?
    if (color == undefined) {
        // No saturation for black or white,
        // so return the next random color instead
        return getRandomLetterColor();
    }
    
    // Return current color hex
    return color;
}
function getRandomLetterColor() {
    // Reset index if we're at the end of the array
    if (currentColorIndex >= colorKeys.length) {
        currentColorIndex = 0;
    }
    
    // Get current color and increment index for next time
    var currentColorKey = colorKeys[currentColorIndex++];
    
    // Return most satured color hex (a700 or 900)
    var color = colors[currentColorKey]['a700'] || colors[currentColorKey]['900'];
    
    // Invalid color saturation value?
    if (color == undefined) {
        // No saturation for black or white,
        // so return the next random color instead
        return getRandomLetterColor();
    }
    
    // Return current color hex
    return color;
}
function getRandomLetterColor ( ) { // Reset index if we're at the end of the array if ( currentColorIndex >= colorKeys . length ) { currentColorIndex = 0 ; } // Get current color and increment index for next time var currentColorKey = colorKeys [ currentColorIndex ++ ] ; // Return most satured color hex (a700 or 900) var color = colors [ currentColorKey ] [ 'a700' ] || colors [ currentColorKey ] [ '900' ] ; // Invalid color saturation value? if ( color == undefined ) { // No saturation for black or white, // so return the next random color instead return getRandomLetterColor ( ) ; } // Return current color hex return color ; }
Returns the next Material Design color for the icon background
Returns the next Material Design color for the icon background