We have 19 Material3 themes at our disposal. So, the idea is to get the primary color from the wallpaper with the help of WallpaperManager (or Palette API on lower than Android 8.1 devices) and compare it with the array of primary colors of the M3 themes we have, and get the closest color to the primary color of the wallpaper from the array. HSL Color space has given the best results so far by ignoring L(lightness) in the process of trial and error.