def decorate_welcome_icon(icon, background_color):
 welcome_icon = QIcon()
 sizes = [32, 48, 64, 80]
 background_color = NAMED_COLORS.get(background_color, background_color)
 background_color = QColor(background_color)
 grad = radial_gradient(background_color)
 for size in sizes:
  icon_pixmap = icon.pixmap(((5 * size) / 8), ((5 * size) / 8))
  icon_size = icon_pixmap.size()
  icon_rect = QRect(QPoint(0, 0), icon_size)
  pixmap = QPixmap(size, size)
  pixmap.fill(QColor(0, 0, 0, 0))
  p = QPainter(pixmap)
  p.setRenderHint(QPainter.Antialiasing, True)
  p.setBrush(QBrush(grad))
  p.setPen(Qt.NoPen)
  ellipse_rect = QRect(0, 0, size, size)
  p.drawEllipse(ellipse_rect)
  icon_rect.moveCenter(ellipse_rect.center())
  p.drawPixmap(icon_rect.topLeft(), icon_pixmap)
  p.end()
  welcome_icon.addPixmap(pixmap)
 return welcome_icon

def decorate_welcome_icon ( icon , background_color ) : welcome_icon = QIcon ( ) sizes = [ 32 , 48 , 64 , 80 ] background_color = NAMED_COLORS . get ( background_color , background_color ) background_color = QColor ( background_color ) grad = radial_gradient ( background_color ) for size in sizes : icon_pixmap = icon . pixmap ( ( ( 5 * size ) / 8 ) , ( ( 5 * size ) / 8 ) ) icon_size = icon_pixmap . size ( ) icon_rect = QRect ( QPoint ( 0 , 0 ) , icon_size ) pixmap = QPixmap ( size , size ) pixmap . fill ( QColor ( 0 , 0 , 0 , 0 ) ) p = QPainter ( pixmap ) p . setRenderHint ( QPainter . Antialiasing , True ) p . setBrush ( QBrush ( grad ) ) p . setPen ( Qt . NoPen ) ellipse_rect = QRect ( 0 , 0 , size , size ) p . drawEllipse ( ellipse_rect ) icon_rect . moveCenter ( ellipse_rect . center ( ) ) p . drawPixmap ( icon_rect . topLeft ( ) , icon_pixmap ) p . end ( ) welcome_icon . addPixmap ( pixmap ) return welcome_icon
return a qicon with a circle shaped background .