Class ProfilePicGenerator

java.lang.Object
com.example.oblong.ProfilePicGenerator

public class ProfilePicGenerator extends Object
Utility class for generating profile pictures with a random background color and the first letter of a given name.
  • Constructor Details

    • ProfilePicGenerator

      public ProfilePicGenerator()
  • Method Details

    • generateProfilePic

      public static android.graphics.Bitmap generateProfilePic(String name)
      Generates a Bitmap representing a profile picture. The picture is a square with a random background color and the first letter of the provided name displayed in white at the center.
      Parameters:
      name - The name to extract the first letter from. If the name is null or empty, a "?" will be displayed instead.
      Returns:
      A Bitmap object representing the generated profile picture.