{"id":20995574,"url":"https://github.com/ddjerqq/rgbprint","last_synced_at":"2025-07-03T07:05:53.444Z","repository":{"id":39606851,"uuid":"465667102","full_name":"ddjerqq/rgbprint","owner":"ddjerqq","description":"This is the official repo for https://pypi.org/project/rgbprint/","archived":false,"fork":false,"pushed_at":"2024-11-08T22:01:46.000Z","size":4901,"stargazers_count":36,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T10:43:04.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddjerqq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-03T10:13:58.000Z","updated_at":"2025-05-16T13:05:24.000Z","dependencies_parsed_at":"2024-06-21T19:08:54.164Z","dependency_job_id":"c5fc1b94-3147-4d62-961d-b5459965907b","html_url":"https://github.com/ddjerqq/rgbprint","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.47058823529411764","last_synced_commit":"50e69aebd5b6f1911bd432dc03c7376d48b8c71a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ddjerqq/rgbprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddjerqq%2Frgbprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddjerqq%2Frgbprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddjerqq%2Frgbprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddjerqq%2Frgbprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddjerqq","download_url":"https://codeload.github.com/ddjerqq/rgbprint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddjerqq%2Frgbprint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263279270,"owners_count":23441681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T07:24:44.449Z","updated_at":"2025-07-03T07:05:53.407Z","avatar_url":"https://github.com/ddjerqq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RGBPRINT 4.0.2\n![rgbprint-in-rainbow-gradient-color](https://qu.ax/taDN.png)\n![rgbprint-blue-purple](https://qu.ax/JLnS.gif)\n![rgbprint-blue-purple](https://qu.ax/pKpa.gif)\n\n## Print gradients and colors on your terminal.\n\n## Components:\n\u003e\n\u003e see below for details.\n\u003e \n\u003e - functions\n\u003e \n\u003e   - rgbprint\n\u003e   - gradient_print\n\u003e   - gradient_scroll\n\u003e   - gradient_change\n\u003e\n\u003e - classes\n\u003e   - Color\n\n# Basic examples:\n\u003e #### use rgbprint:\n\u003e ```python\n\u003e from rgbprint import rgbprint\n\u003e rgbprint(\"[+] successfully connected to database\", color=\"green\")\n\u003e ```\n\u003e ![rgbprint-green](https://qu.ax/bqVd.png)\n\u003e \n\u003e #### inject colors in strings:\n\u003e ```python\n\u003e from rgbprint import Color\n\u003e print(f\"[{Color.red}CRITICAL{Color.reset}] encountered error in the program\")\n\u003e ```\n\u003e ![inject-color](https://qu.ax/RQOn.png)\n\u003e \n\u003e #### print gradients\n\u003e ```python\n\u003e from rgbprint import gradient_print, Color\n\u003e gradient_print(\n\u003e     \"[CRITICAL] system failure, program can't open file in location C:/foo/bar/baz.tgz\", \n\u003e     start_color=Color.yellow_green, \n\u003e     end_color=Color.dark_magenta\n\u003e )\n\u003e ```\n\u003e ![gradient-print](https://qu.ax/snQA.png)\n\u003e \n\u003e #### scroll gradients\n\u003e ```python\n\u003e from rgbprint import gradient_scroll, Color\n\u003e gradient_scroll(\n\u003e     \"[CRITICAL] system failure, program can't open file in location C:/foo/bar/baz.tgz\", \n\u003e     start_color=0x4BBEE3, \n\u003e     end_color=Color.medium_violet_red\n\u003e )\n\u003e ```\n\u003e ![gradient-scroll](https://qu.ax/uyo.gif)\n\u003e \n\u003e #### change gradients\n\u003e ```python\n\u003e from rgbprint import gradient_change, Color\n\u003e gradient_change(\n\u003e     \"[CRITICAL] system failure, program can't open file in location C:/foo/bar/baz.tgz\", \n\u003e     start_color=0x4BBEE3, \n\u003e     end_color=Color.medium_violet_red\n\u003e )\n\u003e ```\n\u003e ![gradient-scroll](https://qu.ax/uegj.gif)\n\n# Basic Results\n![chimera](https://qu.ax/FMFZ.png)\n![ninetails-email-spoofer](https://qu.ax/Cxcj.png)\n\n# Functions:\n\n## rgbprint\n![rgbprint-green](https://qu.ax/bqVd.png)\n\u003e print but with color keyword argument support.\n\u003e \n\u003e Prints the values to sys.stdout.\n\u003e \n\u003e the color argument gets converted to a `Color` object before getting printed, thus it must be an instance of `ColorType`\n\u003e \n\u003e ```python\n\u003e rgbprint(\n\u003e       *values, \n\u003e       sep: str = \" \",\n\u003e       end: str = \"\\n\", \n\u003e       color: Optional[ColorType] = None,\n\u003e ) -\u003e None\n\u003e ```\n\n\u003e ### Args:\n\u003e - *values (`Any`): values to print.\n\u003e - color (`ColorType`): `optional` color. see examples down below for supported formats.\n\u003e - sep (`str`): `optional`, string inserted between values, default a space.\n\u003e - end (`str`): `optional`, string appended after the last value, default a newline.\n\n\u003e ### Examples:\n\u003e import the package\n\u003e ```python\n\u003e from rgbprint import rgbprint \n\u003e from rgbprint import Color \n\u003e ```\n\u003e basic colored print\n\u003e ```python\n\u003e user = \"john smith\"\n\u003e rgbprint(\"welcome\", user, \"you are\", 25, \"years old\", color=Color.forest_green)\n\u003e ```\n\u003e similar functionality to the built-in `print` function, support for unpacking iterables.\n\u003e ```python\n\u003e rgbprint(*[\"orange\", \"apple\", \"banana\"], sep=\"_\", color=\"yellow\")\n\u003e ```\n\u003e all supported color formats\n\u003e ```python\n\u003e rgbprint(\"hello\", color=\"red\")\n\u003e rgbprint(\"hello\", color=0xff00ff)\n\u003e rgbprint(\"hello\", color=\"#ff00ff\")\n\u003e rgbprint(\"hello\", color=\"ff00ff\")\n\u003e rgbprint(\"hello\", color=[255, 0, 255])\n\u003e rgbprint(\"hello\", color=(255, 0, 255))\n\u003e rgbprint(\"hello\", color=(255, 0, 0xFF))\n\u003e rgbprint(\"hello\", color=Color.red)\n\u003e rgbprint(\"hello\", color=Color.random)\n\u003e rgbprint(\"hello\", color=Color(255, 0, 127))\n\u003e ```\n\n\u003e ### Raises:\n\u003e - ValueError: if the color is in an unsupported format, or is out of range of 0-16777215 (0x000000-0xFFFFFF).\n\u003e - TypeError: if the color is of unsupported type. or some other error.\n\n## gradient_print\n![gradient-print](https://qu.ax/snQA.png)\n\u003e print gradients on your terminal\n\u003e ```python\n\u003e gradient_print(\n\u003e       *values, \n\u003e       start_color: Optional[ColorType] = None, \n\u003e       end_color: Optional[ColorType] = None, \n\u003e       sep: str = \" \", \n\u003e       end: str = \"\\n\"\n\u003e ) -\u003e None\n\u003e ```\n\n\u003e ### Args:\n\u003e - *values (`Any`): values to print.\n\u003e - start_color (`ColorType`): start_color. see examples down below for supported formats.\n\u003e - end_color (`ColorType`): end_color. see examples down below for supported formats.\n\u003e - sep (`str`): `optional`, string inserted between values, default a space.\n\u003e - end (`str`): `optional`, string appended after the last value, default a newline.\n\n\u003e ### Examples:\n\u003e import the package\n\u003e ```python\n\u003e from rgbprint import gradient_print\n\u003e from rgbprint import Color \n\u003e ```\n\u003e basic gradient scroll\n\u003e ```python\n\u003e user = \"john smith\"\n\u003e gradient_print(\"welcome\", user, \"you are\", 25, \"years old\", start_color=\"red, end_color=\"yellow\")\n\u003e ```\n\u003e more examples\n\u003e ```python\n\u003e username = \"john doe\"\n\u003e gradient_print(\"hello\", start_color=\"red\", end_color=\"yellow\")\n\u003e gradient_print(\"hello\", username, \"welcome to the app\", start_color=Color.forest_green, end_color=0xFF00FF)\n\u003e gradient_print(\"[+] loading data, please wait...\", start_color=Color.aqua_marine, end_color=Color.peach_puff)\n\u003e ```\n\u003e similar functionality to the built-in `print` function, support for unpacking iterables.\n\u003e ```python\n\u003e gradient_print(*[\"orange\", \"apple\", \"banana\"], sep=\"_\", start_color=\"yellow\", end_color=\"red\")\n\u003e ```\n\u003e all supported color formats\n\u003e ```python\n\u003e gradient_print(\"hello\", start_color=\"red\",              end_color=\"red\")\n\u003e gradient_print(\"hello\", start_color=0xff00ff,           end_color=0xff00ff)\n\u003e gradient_print(\"hello\", start_color=\"#ff00ff\",          end_color=\"#ff00ff\")\n\u003e gradient_print(\"hello\", start_color=\"ff00ff\",           end_color=\"ff00ff\")\n\u003e gradient_print(\"hello\", start_color=[255, 0, 255],      end_color=[255, 0, 255])\n\u003e gradient_print(\"hello\", start_color=(255, 0, 255),      end_color=(255, 0, 255))\n\u003e gradient_print(\"hello\", start_color=(255, 0, 0xFF),     end_color=(255, 0, 0xFF))\n\u003e gradient_print(\"hello\", start_color=Color.red,          end_color=Color.red)\n\u003e gradient_print(\"hello\", start_color=Color.random,       end_color=Color.random)\n\u003e gradient_print(\"hello\", start_color=Color(255, 0, 127), end_color=Color(255, 0, 127))\n\u003e ```\n\n\u003e ### Raises:\n\u003e - ValueError: if the color is in an unsupported format, or is out of range of 0-16777215 (0x000000-0xFFFFFF).\n\u003e - TypeError: if the color is of unsupported type, or the function is missing arguments.\n\n## gradient_scroll\n![gradient-scroll](https://qu.ax/uyo.gif)\n\u003e scroll gradients on your terminal\n\u003e ```python\n\u003e gradient_scroll(\n\u003e       *values, \n\u003e       start_color: Optional[ColorType] = None, \n\u003e       end_color: Optional[ColorType] = None,\n\u003e       delay: float = 0.03,\n\u003e       times: int = 4,\n\u003e       reverse: bool = False,\n\u003e       sep: str = \" \", \n\u003e       end: str = \"\\n\",\n\u003e ) -\u003e None\n\u003e ```\n\n\u003e ### Args:\n\u003e - *values (`Any`): values to print.\n\u003e - start_color (`ColorType`): start_color. see examples down below for supported formats.\n\u003e - end_color (`ColorType`): end_color. see examples down below for supported formats.\n\u003e - delay (`float`): `optional`, the delay between the change of the gradient, recommended range: .05 - .1\n\u003e - times (`int`): `optional`, the amount of times to change the gradient in place.\n\u003e - reverse (`bool`): `optional` whether to start with the end color or not.\n\u003e - sep (`str`): `optional`, string inserted between values, default a space.\n\u003e - end (`str`): `optional`, string appended after the last value, default a newline.\n\n\u003e ### Examples:\n\u003e import the package\n\u003e ```python\n\u003e from rgbprint import gradient_scroll\n\u003e from rgbprint import Color \n\u003e ```\n\u003e basic gradient print\n\u003e ```python\n\u003e user = \"john smith\"\n\u003e gradient_scroll(\"welcome\", user, \"you are\", 25, \"years old\", start_color=\"red\", end_color=\"yellow\")\n\u003e ```\n\u003e more examples\n\u003e ```python\n\u003e username = \"john doe\"\n\u003e gradient_scroll(\"hello\", start_color=\"red\", end_color=\"yellow\")\n\u003e gradient_scroll(\"hello\", start_color=\"red\", end_color=\"yellow\", delay=0.1)\n\u003e gradient_scroll(\"hello\", start_color=\"red\", end_color=\"yellow\", delay=0.1, times=10)\n\u003e gradient_scroll(\"hello\", start_color=\"red\", end_color=\"yellow\", delay=0.1, times=10, reverse=True)\n\u003e gradient_scroll(\"hello\", username, \"welcome to the app\", start_color=Color.forest_green, end_color=0xFF00FF)\n\u003e gradient_scroll(\"[+] loading data, please wait...\", start_color=Color.aqua_marine, end_color=Color.peach_puff)\n\u003e ```\n\u003e similar functionality to the built-in `print` function, support for unpacking iterables.\n\u003e ```python\n\u003e gradient_scroll(*[\"orange\", \"apple\", \"banana\"], sep=\"_\", start_color=\"yellow\", end_color=\"red\")\n\u003e ```\n\u003e all supported color formats\n\u003e ```python\n\u003e gradient_scroll(\"hello\", start_color=\"red\",              end_color=\"red\")\n\u003e gradient_scroll(\"hello\", start_color=0xff00ff,           end_color=0xff00ff)\n\u003e gradient_scroll(\"hello\", start_color=\"#ff00ff\",          end_color=\"#ff00ff\")\n\u003e gradient_scroll(\"hello\", start_color=\"ff00ff\",           end_color=\"ff00ff\")\n\u003e gradient_scroll(\"hello\", start_color=[255, 0, 255],      end_color=[255, 0, 255])\n\u003e gradient_scroll(\"hello\", start_color=(255, 0, 255),      end_color=(255, 0, 255))\n\u003e gradient_scroll(\"hello\", start_color=(255, 0, 0xFF),     end_color=(255, 0, 0xFF))\n\u003e gradient_scroll(\"hello\", start_color=Color.red,          end_color=Color.red)\n\u003e gradient_scroll(\"hello\", start_color=Color.random,       end_color=Color.random)\n\u003e gradient_scroll(\"hello\", start_color=Color(255, 0, 127), end_color=Color(255, 0, 127))\n\u003e ```\n\n\u003e ### Raises:\n\u003e - ValueError: if the color is in an unsupported format, or is out of range of 0-16777215 (0x000000-0xFFFFFF).\n\u003e - TypeError: if the color is of unsupported type, or the function is missing arguments.\n\n## gradient_change\n![gradient-scroll](https://qu.ax/uegj.gif)\n\u003e change gradients in place on your terminal\n\u003e this function is very similar to `gradient_scroll` almost identical.\n\u003e ```python\n\u003e gradient_change(\n\u003e       *values, \n\u003e       start_color: Optional[ColorType] = None, \n\u003e       end_color: Optional[ColorType] = None,\n\u003e       delay: float = 0.03,\n\u003e       times: int = 4,\n\u003e       reverse: bool = False,\n\u003e       sep: str = \" \", \n\u003e       end: str = \"\\n\",\n\u003e ) -\u003e None\n\u003e ```\n\n\u003e ### Args:\n\u003e - *values (`Any`): values to print.\n\u003e - start_color (`ColorType`): start_color. see examples down below for supported formats.\n\u003e - end_color (`ColorType`): end_color. see examples down below for supported formats.\n\u003e - delay (`float`): `optional`, the delay between the change of the gradient, recommended range: .05 - .1\n\u003e - times (`int`): `optional`, the amount of times to change the gradient in place.\n\u003e - reverse (`bool`): `optional` whether to start with the end color or not.\n\u003e - sep (`str`): `optional`, string inserted between values, default a space.\n\u003e - end (`str`): `optional`, string appended after the last value, default a newline.\n\n\u003e ### Examples:\n\u003e import the package\n\u003e ```python\n\u003e from rgbprint import gradient_change\n\u003e from rgbprint import Color \n\u003e ```\n\u003e basic gradient print\n\u003e ```python\n\u003e user = \"john smith\"\n\u003e gradient_change(\"welcome\", user, \"you are\", 25, \"years old\", start_color=\"red, end_color=\"yellow\")\n\u003e ```\n\u003e more examples\n\u003e ```python\n\u003e username = \"john doe\"\n\u003e gradient_change(\"hello\", start_color=\"red\", end_color=\"yellow\")\n\u003e gradient_change(\"hello\", start_color=\"red\", end_color=\"yellow\", delay=0.1)\n\u003e gradient_change(\"hello\", start_color=\"red\", end_color=\"yellow\", delay=0.1, times=10)\n\u003e gradient_change(\"hello\", start_color=\"red\", end_color=\"yellow\", delay=0.1, times=10, reverse=True)\n\u003e gradient_change(\"hello\", username, \"welcome to the app\", start_color=Color.forest_green, end_color=0xFF00FF)\n\u003e gradient_change(\"[+] loading data, please wait...\", start_color=Color.aqua_marine, end_color=Color.peach_puff)\n\u003e ```\n\u003e similar functionality to the built-in `print` function, support for unpacking iterables.\n\u003e ```python\n\u003e gradient_change(*[\"orange\", \"apple\", \"banana\"], sep=\"_\", start_color=\"yellow\", end_color=\"red\")\n\u003e ```\n\u003e all supported color formats\n\u003e ```python\n\u003e gradient_change(\"hello\", start_color=\"red\",              end_color=\"red\")\n\u003e gradient_change(\"hello\", start_color=0xff00ff,           end_color=0xff00ff)\n\u003e gradient_change(\"hello\", start_color=\"#ff00ff\",          end_color=\"#ff00ff\")\n\u003e gradient_change(\"hello\", start_color=\"ff00ff\",           end_color=\"ff00ff\")\n\u003e gradient_change(\"hello\", start_color=[255, 0, 255],      end_color=[255, 0, 255])\n\u003e gradient_change(\"hello\", start_color=(255, 0, 255),      end_color=(255, 0, 255))\n\u003e gradient_change(\"hello\", start_color=(255, 0, 0xFF),     end_color=(255, 0, 0xFF))\n\u003e gradient_change(\"hello\", start_color=Color.red,          end_color=Color.red)\n\u003e gradient_change(\"hello\", start_color=Color.random,       end_color=Color.random)\n\u003e gradient_change(\"hello\", start_color=Color(255, 0, 127), end_color=Color(255, 0, 127))\n\u003e ```\n\n\u003e ### Raises:\n\u003e - ValueError: if the color is in an unsupported format, or is out of range of 0-16777215 (0x000000-0xFFFFFF).\n\u003e - TypeError: if the color is of unsupported type, or the function is missing arguments.\n\n# Classes:\n\n## Color\n\u003e Color class, to represent a 8bit ANSI colors\n\u003e \n\u003e instances of this class are printable, when you print them, they change the color of your terminal.\n\u003e ```python\n\u003e Color(r, g, b)\n\u003e ```\n\n\u003e ## Slots:\n\u003e \n\u003e - r: (`int` in `0..256`): red value of the color\n\u003e - g: (`int` in `0..256`): green value of the color\n\u003e - b: (`int` in `0..256`): blue value of the color\n\n\u003e ## Initialization: \n\u003e all the ways below are valid to initialize a color:\n\u003e ```python\n\u003e Color(0xff00ff)\n\u003e Color(\"#ff00ff\")\n\u003e Color(\"ff00ff\")\n\u003e Color([255, 0, 255])\n\u003e Color(255, 0, 255)\n\u003e Color(255, 0, 0xFF)\n\u003e Color(Color.red)\n\u003e Color(Color.random)\n\u003e ```\n\n\u003e ## Different ways to initialize colors: \n\u003e colors can be initialized in many ways:\n\u003e - `Color(int, int, int)` \n\u003e   - `Color(255, 0, 255)` \n\u003e   - `Color(0x4B, 0xBB, 0xE3)` \n\u003e   - `Color(*(127, 127, 127))` \n\u003e\n\u003e \n\u003e - `Color(str)`\n\u003e   - `Color(\"#FF00FF\")` \n\u003e   - `Color(\"FF00FF\")` \n\u003e   - `Color(\"red)` \n\u003e   - `Color(\"green\")`\n\u003e\n\u003e \n\u003e - `Color(int)`\n\u003e   - `Color(0x4BBEE3)` \n\u003e   - `Color(16777215)`\n\u003e \n\u003e \n\u003e - `Color(Color)`\n\u003e   - `red = Color.red; Color(red)`\n\u003e \n\u003e \n\u003e - `Color(Tuple[int, int, int] | List[int, int, int])`\n\u003e   - `Color((100, 255, 16))`\n\u003e   - `Color([100, 255, 16])`\n \n\u003e ## Destruction\n\u003e you can destruct colors into its red, green, blue components like so:\n\u003e ```python\n\u003e r, g, b = Color.red\n\u003e assert r == 255\n\u003e assert g == 0\n\u003e assert b == 0\n\u003e \n\u003e rgb = tuple(Color(\"FF00FF\"))\n\u003e assert isinstance(rgb, tuple)\n\u003e assert rgb == (255, 0, 255)\n\u003e ```\n\n\u003e ## Dunder/magic method implementations:\n\u003e the color class has some dunder magic methods implemented.\n\u003e \n\u003e - `__iter__` to destruct the colors.\n\u003e - `__str__` to print the colors.\n\u003e - `__repr__` to represent colors for debugging purposes.\n\u003e - `__eq__` to compare 2 colors, and see if they are the same color.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddjerqq%2Frgbprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddjerqq%2Frgbprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddjerqq%2Frgbprint/lists"}