getImageByName

fun getImageByName(context: Context, imageName: String): Int

Retrieves the resource ID of an image by its name.

This function searches for an image resource with the specified name in the drawable resources. If the image is not found, it returns the default planet image resource ID.

Return

The resource ID of the image, or the default planet image resource ID if not found.

Parameters

context

The application context.

imageName

The name of the image to search for.