python-scripts/scripts/CMYK To RGB/CMYKtoRGB.py

19 lines
585 B
Python
Raw Normal View History

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")
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))