Merge pull request #156 from biv720/master

CMYK to RGB script added.
This commit is contained in:
Advaita Saha 2022-10-07 13:56:02 +05:30 committed by GitHub
commit a43b89c2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,18 @@
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)
print("Welcome To CMYK to RGB Convertor || INPUT CMYK codes and rest leave it to the convertor\n")
c=int(input("C Value: "))
m=int(input("M Value: "))
y=int(input("Y Value: "))
k=int(input("K Value: "))
print("Processing...")
print("\nYour RGB values are", CMYKtoRGB(c,m,y,k))

View File

@ -0,0 +1,9 @@
# CMKY to RGB
This is a simple python script, that allows the user to covert CMYK color values into RGB values.
## Usage
* No additional package reqd. Just the script
* Run `CMYKtoRGB.py`
* Input the CMYK values, when asked
* There you go, RGB Value is provided