从黄色溢出到白色的问题

problems with overflow from yellow to white

我的任务是:有一个白色 sheet,向其添加文本,嵌入图片并制作渐变。我了解如何添加文本和嵌入图像。下面是如何进行溢出。比如从黄色到白色或者从黑色到白色,我不会understand.I也想了解如何移动一朵云最后的画面应该是这样的enter image description here

我的代码:

import cv2
white_list = cv2.imread('python_snippets/external_data/probe.jpg')
cloud = cv2.imread('python_snippets/external_data/weather_img/cloud.jpg')
white_list[:cloud.shape[0], :cloud.shape[1]] = cloud
font = cv2.FONT_HERSHEY_SIMPLEX
org = (50, 50)
fontScale = 1
color = (255, 0, 0)
thickness = 2
cv2.putText(white_list, '+5', org, font,
                    fontScale, color, thickness, cv2.LINE_AA)
cv2.imshow('img', white_list)
cv2.waitKey(0)
cv2.destroyAllWindows()
def painting_background(self, color, white_list):
    r, g, b = color
    for x in range(white_list.shape[1]):
        if r < 255:
            r += 1
        if g < 255:
            g += 1
        if b < 255:
            b += 1
        self.white_list[:, x:x + 1] = (r, g, b)

def maker(self, color, degree):
    x = 0
    y = 400
    weather_icon = self.weather_icons[color]
    self.painting_background(color, self.white_list)
    self.white_list[x:x + weather_icon.shape[0], y:y + weather_icon.shape[1]] = weather_icon
    cv2.putText(self.white_list, degree, (360, 150), cv2.FONT_HERSHEY_DUPLEX, 2, (255, 0, 0), 2, cv2.LINE_AA)