mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-27 14:01:12 +00:00
CMYK to RGB script added.
A python based CMYK to RGB convertor has been added.
This commit is contained in:
parent
46c3c6b88a
commit
d8de1da9ef
18
scripts/CMYK To RGB/CMYKtoRGB.py
Normal file
18
scripts/CMYK To RGB/CMYKtoRGB.py
Normal 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))
|
9
scripts/CMYK To RGB/README.md
Normal file
9
scripts/CMYK To RGB/README.md
Normal 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
|
Loading…
Reference in New Issue
Block a user