colorim 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
colorim-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: colorim
3
+ Version: 0.1.1
4
+ Summary: A library based off Colorama/Rich with extra features like RGB and hex
5
+ Author: im-lemon
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+
9
+ # Colorim
10
+
11
+ ---
12
+ Colorim is a python package made by me, it uses ANSI codes to make coloured text, as well as RGB.
13
+ Colorim is **inspired by Colorama and Rich**, but Colorim allows for more options when making coloured text, such as:
14
+
15
+ - RGB Text, with ```print(Rgb.rgb(r,g,b, text)```
16
+
17
+ - Hex text, with: ```print(Hex.hex(#ff0000))```
18
+
19
+ - And the predefined colours with: ```print(Color.red("hello world"))```
20
+
21
+ ---
22
+ Upcoming updates:
23
+ -
24
+ - Gradient (Lolcat) type text.
25
+ - More custom predefined colours.
26
+ - *And more!*
@@ -0,0 +1,18 @@
1
+ # Colorim
2
+
3
+ ---
4
+ Colorim is a python package made by me, it uses ANSI codes to make coloured text, as well as RGB.
5
+ Colorim is **inspired by Colorama and Rich**, but Colorim allows for more options when making coloured text, such as:
6
+
7
+ - RGB Text, with ```print(Rgb.rgb(r,g,b, text)```
8
+
9
+ - Hex text, with: ```print(Hex.hex(#ff0000))```
10
+
11
+ - And the predefined colours with: ```print(Color.red("hello world"))```
12
+
13
+ ---
14
+ Upcoming updates:
15
+ -
16
+ - Gradient (Lolcat) type text.
17
+ - More custom predefined colours.
18
+ - *And more!*
@@ -0,0 +1,5 @@
1
+ from .colors import Color
2
+ from .rgb import Rgb
3
+ from .hex_codes import Hex
4
+
5
+ __all__ = ["Hex","Rgb","Color"]
@@ -0,0 +1,45 @@
1
+ class Color:
2
+ RED_CODE = "\033[31;1m"
3
+ GREEN_CODE = "\033[32;1m"
4
+ BLUE_CODE = "\033[34;1m"
5
+ PURPLE_CODE = "\033[38;2;179;0;254m"
6
+ CYAN_CODE = "\033[36;1m"
7
+ YELLOW_CODE = "\033[0;93m"
8
+ LIGHT_YELLOW_CODE = "\033[1;93m"
9
+ END = "\033[0m"
10
+ RGB_END = "\x1b[0m"
11
+
12
+ @classmethod
13
+ def red(cls, text):
14
+ output=cls.RED_CODE+text+cls.END
15
+ return output
16
+
17
+ @classmethod
18
+ def green(cls, text):
19
+ output=cls.GREEN_CODE+text+cls.END
20
+ return output
21
+
22
+ @classmethod
23
+ def blue(cls, text):
24
+ output=cls.BLUE_CODE+text+cls.END
25
+ return output
26
+
27
+ @classmethod
28
+ def purple(cls, text):
29
+ output=cls.PURPLE_CODE+text+cls.RGB_END
30
+ return output
31
+
32
+ @classmethod
33
+ def cyan(cls, text):
34
+ output=cls.CYAN_CODE+text+cls.END
35
+ return output
36
+
37
+ @classmethod
38
+ def yellow(cls, text):
39
+ output=cls.YELLOW_CODE+text+cls.END
40
+ return output
41
+
42
+ @classmethod
43
+ def light_yellow(cls, text):
44
+ output=cls.LIGHT_YELLOW_CODE+text+cls.END
45
+ return output
@@ -0,0 +1,15 @@
1
+ from .rgb import Rgb
2
+ class Hex:
3
+ @classmethod
4
+ def hex(cls, hex_code, text):
5
+ hex_code = hex_code.lstrip('#').lower()
6
+ if len(hex_code) != 6:
7
+ raise ValueError('Invalid hex code')
8
+ else:
9
+ r=hex_code[0:2]
10
+ g=hex_code[2:4]
11
+ b=hex_code[4:6]
12
+ r=int(r,16)
13
+ g=int(g,16)
14
+ b=int(b,16)
15
+ return Rgb.rgb(r,g,b, text=text)
@@ -0,0 +1,8 @@
1
+ class Rgb:
2
+ END = "\x1b[0m"
3
+
4
+ @classmethod
5
+ def rgb(cls, r, g, b, text):
6
+ esc_string = f"\033[38;2;{r};{g};{b}m"
7
+ output = esc_string + text + cls.END
8
+ return output
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: colorim
3
+ Version: 0.1.1
4
+ Summary: A library based off Colorama/Rich with extra features like RGB and hex
5
+ Author: im-lemon
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+
9
+ # Colorim
10
+
11
+ ---
12
+ Colorim is a python package made by me, it uses ANSI codes to make coloured text, as well as RGB.
13
+ Colorim is **inspired by Colorama and Rich**, but Colorim allows for more options when making coloured text, such as:
14
+
15
+ - RGB Text, with ```print(Rgb.rgb(r,g,b, text)```
16
+
17
+ - Hex text, with: ```print(Hex.hex(#ff0000))```
18
+
19
+ - And the predefined colours with: ```print(Color.red("hello world"))```
20
+
21
+ ---
22
+ Upcoming updates:
23
+ -
24
+ - Gradient (Lolcat) type text.
25
+ - More custom predefined colours.
26
+ - *And more!*
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ colorim/__init__.py
4
+ colorim/colors.py
5
+ colorim/hex_codes.py
6
+ colorim/rgb.py
7
+ colorim.egg-info/PKG-INFO
8
+ colorim.egg-info/SOURCES.txt
9
+ colorim.egg-info/dependency_links.txt
10
+ colorim.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ colorim
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "colorim"
7
+ version = "0.1.1"
8
+ description = "A library based off Colorama/Rich with extra features like RGB and hex"
9
+ authors = [
10
+ { name = "im-lemon" }
11
+ ]
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ dependencies = []
15
+
16
+ [tool.setuptools]
17
+ packages = ["colorim"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+