2022-10-05 08:35:46 +00:00
|
|
|
def CMYKtoRGB(c, m, y, k) :
|
|
|
|
c=float(c)/100.0
|
|
|
|
m=float(m)/100.0
|
|
|
|
y=float(y)/100.0
|
|
|
|
k=float(k)/100.0
|
|
|
|
r=round(255.0-((min(1.0, c*(1.0-k)+k))*255.0))
|
|
|
|
g=round(255.0-((min(1.0, m*(1.0-k)+k))*255.0))
|
|
|
|
b=round(255.0-((min(1.0, y*(1.0-k)+k))*255.0))
|
|
|
|
return (r,g,b)
|
|
|
|
|
2022-12-24 04:57:33 +00:00
|
|
|
print("Welcome to the CMYK to RGB Convertor || Input CMYK codes and rest leave it to the converter\n")
|
2022-10-05 08:35:46 +00:00
|
|
|
c=int(input("C Value: "))
|
|
|
|
m=int(input("M Value: "))
|
|
|
|
y=int(input("Y Value: "))
|
|
|
|
k=int(input("K Value: "))
|
|
|
|
|
|
|
|
print("Processing...")
|
2022-12-24 04:57:33 +00:00
|
|
|
print("\nYour RGB values are", CMYKtoRGB(c,m,y,k))
|