protected String generateBackgroundColor(Avatar avatar) {
        return String.format(
                "background-color:hsla(%d,%d%%,%d%%,%d%%)",
                Math.abs((avatar.getLabel().hashCode() % 40) * 9),
                avatar.getSaturation(),
                avatar.getLightness(),
                avatar.getAlpha()
        );
    }
Generates a dynamic color based on the hash of the label.

@param avatar to generate the color for
@return the new color and background color styles
primefaces/src/main/java/org/primefaces/component/avatar/AvatarRenderer.java