{"id":28331830,"url":"https://github.com/irtsa-dev/pycolor","last_synced_at":"2025-10-14T01:05:16.167Z","repository":{"id":182953937,"uuid":"669368580","full_name":"irtsa-dev/PyColor","owner":"irtsa-dev","description":"A python collection of classes and functions to convert between multiple color models, generate palettes, and more.","archived":false,"fork":false,"pushed_at":"2024-11-21T19:59:06.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T23:08:40.153Z","etag":null,"topics":["color","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irtsa-dev.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":"2023-07-22T04:14:41.000Z","updated_at":"2024-11-21T19:53:49.000Z","dependencies_parsed_at":"2024-01-28T06:33:46.378Z","dependency_job_id":"dac4e0d4-bef4-4c07-b01a-64041304d41d","html_url":"https://github.com/irtsa-dev/PyColor","commit_stats":null,"previous_names":["irtsadevelopment/pycolor","irtsa-dev/pycolor"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/irtsa-dev/PyColor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irtsa-dev%2FPyColor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irtsa-dev%2FPyColor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irtsa-dev%2FPyColor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irtsa-dev%2FPyColor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irtsa-dev","download_url":"https://codeload.github.com/irtsa-dev/PyColor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irtsa-dev%2FPyColor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260692793,"owners_count":23047496,"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":["color","python"],"created_at":"2025-05-26T18:57:27.641Z","updated_at":"2025-10-14T01:05:16.161Z","avatar_url":"https://github.com/irtsa-dev.png","language":"Python","readme":" ![PyPI](https://img.shields.io/pypi/v/idev-pycolor) ![Python](https://img.shields.io/pypi/pyversions/idev-pycolor)\n# PyColor\nA [**python**](https://www.python.org) collection of classes and functions to convert between multiple color models, generate palettes, and more.\n\u003cbr /\u003e\n- **RGB** (*red*, *green*, *blue*)\n- **HSV** (*hue*, *saturation*, *value*)\n- **HSL** (*hue*, *saturation*, *lightness*)\n- **XYZ** (*x*, *y*, *z*)\n- **YCC** (*y*, *cb*, *cr*)\n- **CMYK** (*cyan*, *magenta*, *yellow*, *key*)\n- **HEX** (*hexidecimal*)\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Installation\nWith `git` [GitHub](https://github.com/IrtsaDevelopment/PyColor):\n```\ngit clone https://github.com/irtsa-dev/PyColor.git\n```\nor with `pip` [PyPi](https://pypi.org/project/idev-pycolor/):\n```\npip install idev-pycolor\n```\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Usage\nTo import, simply put:\n```py\nfrom PyColor.Colors import *\nfrom PyColor.Functions import *\nfrom PyColor.Palettes import GeneratePalette\n```\n\u003cbr /\u003e\n\nThen, later on you may utilize:\n```py\nrgb = RGB(100, 100, 100)\nhsv = HSV(200, 100, 100)\nhsl = HSL(200, 100, 100)\nxyz = XYZ(10.0, 10.0, 80.0)\nycc = YCC(100.0, 150.0, 80.0)\ncmyk = CMYK(100, 100, 100, 100)\nhexidecimal = HEX(\"#121212\")\n```\n```py\nrgb.rgb\n# Returns a tuple of the rgb values from rgb.\nrgb.hsv\n# Returns a tuple of the hsv values from rgb.\nrgb.hsl\n# Retuns a tuple of the hsl values from rgb.\nrgb.xyz\n# Returns a tuple of the xyz values from rgb.\nrgb.ycc\n# Returns a tuple of the ycc values from rgb.\nrgb.cmyk\n# Returns a tuple of the cmyk values from rgb.\nrgb.hexidecimal\n# Returns a string of the hexidecimal value from rgb.\n\nrgb.percentForm\n# Returns a tuple of the rgb values in a decimal percent form (0-1).\nrgb.grayscale\n# Returns a grayscaled version of the RGB class.\nrgb.greyscale\n# Is .grayscale\n```\n```py\nhsv.rgb\n# Returns a tuple of the rgb values from hsv.\nhsv.hsv\n# Returns a tuple of the hsv values from hsv.\nhsv.hsl\n# Retuns a tuple of the hsl values from hsv.\nhsv.xyz\n# Returns a tuple of the xyz values from hsv.\nhsv.ycc\n# Returns a tuple of the ycc values from hsv.\nhsv.cmyk\n# Returns a tuple of the cmyk values from hsv.\nhsv.hexidecimal\n# Returns a string of the hexidecimal value from hsv.\n\nhsv.percentForm\n# Returns a tuple of the hsv values in a decimal percent form (0-1).\nhsv.grayscale\n# Returns a grayscaled version of the HSV class.\nhsv.greyscale\n# Is .grayscale\n```\n```py\nhsl.rgb\n# Returns a tuple of the rgb values from hsl.\nhsl.hsv\n# Returns a tuple of the hsv values from hsl.\nhsl.hsl\n# Retuns a tuple of the hsl values from hsl.\nhsl.xyz\n# Returns a tuple of the xyz values from hsl.\nhsl.ycc\n# Returns a tuple of the ycc values from hsl.\nhsl.cmyk\n# Returns a tuple of the cmyk values from hsl.\nhsl.hexidecimal\n# Returns a string of the hexidecimal value from hsl.\n\nhsl.percentForm\n# Returns a tuple of the hsl values in a decimal percent form (0-1).\nhsl.grayscale\n# Returns a grayscaled version of the HSL class.\nhsl.greyscale\n# Is .grayscale\n```\n```py\nxyz.rgb\n# Returns a tuple of the rgb values from xyz.\nxyz.hsv\n# Returns a tuple of the hsv values from xyz.\nxyz.hsl\n# Retuns a tuple of the hsl values from xyz.\nxyz.xyz\n# Returns a tuple of the xyz values from xyz.\nxyz.ycc\n# Returns a tuple of the ycc values from xyz.\nxyz.cmyk\n# Returns a tuple of the cmyk values from xyz.\nxyz.hexidecimal\n# Returns a string of the hexidecimal value from xyz.\n\nxyz.percentForm\n# Returns a tuple of the xyz values in a decimal percent form (0-1).\nxyz.grayscale\n# Returns a grayscaled version of the XYZ class.\nxyz.greyscale\n# Is .grayscale\n```\n```py\nycc.rgb\n# Returns a tuple of the rgb values from ycc.\nycc.hsv\n# Returns a tuple of the hsv values from ycc.\nycc.hsl\n# Retuns a tuple of the hsl values from ycc.\nycc.xyz\n# Returns a tuple of the xyz values from ycc.\nycc.ycc\n# Returns a tuple of the ycc values from ycc.\nycc.cmyk\n# Returns a tuple of the cmyk values from ycc.\nycc.hexidecimal\n# Returns a string of the hexidecimal value from ycc.\n\nycc.percentForm\n# Returns a tuple of the ycc values in a decimal percent form (0-1).\nycc.grayscale\n# Returns a grayscaled version of the YCC class.\nycc.greyscale\n# Is .grayscale\n```\n```py\ncmyk.rgb\n# Returns a tuple of the rgb values from cmyk.\ncmyk.hsv\n# Returns a tuple of the hsv values from cmyk.\ncmyk.hsl\n# Retuns a tuple of the hsl values from cmyk.\ncmyk.xyz\n# Returns a tuple of the xyz values from cmyk.\ncmyk.ycc\n# Returns a tuple of the ycc values from cmyk.\ncmyk.cmyk\n# Returns a tuple of the cmyk values from cmyk.\ncmyk.hexidecimal\n# Returns a string of the hexidecimal value from cmyk.\n\ncmyk.percentForm\n# Returns a tuple of the cmyk values in a decimal percent form (0-1).\ncmyk.grayscale\n# Returns a grayscaled version of the CMYK class.\ncmyk.greyscale\n# Is .grayscale\n```\n```py\nhexidecimal.rgb\n# Returns a tuple of the rgb values from hexidecimal.\nhexidecimal.hsv\n# Returns a tuple of the hsv values from hexidecimal.\nhexidecimal.hsl\n# Retuns a tuple of the hsl values from hexidecimal.\nhexidecimal.xyz\n# Returns a tuple of the xyz values from hexidecimal.\nhexidecimal.ycc\n# Returns a tuple of the ycc values from hexidecimal.\nhexidecimal.cmyk\n# Returns a tuple of the cmyk values from hexidecimal.\nhexidecimal.hexidecimal\n# Returns a string of the hexidecimal value from hexidecimal.\n\nhexidecimal.percentForm\n# Returns a decimal percent form (0-1) of the hexidecimal value.\nhexidecimal.grayscale\n# Returns a grayscaled version of the HEX class.\nhexidecimal.greyscale\n# Is .grayscale\n```\n```py\nprint(rgb)\n# Will print off a string representation of the rgb values.\n\nprint(hsv)\n# Will print off a string representation of the hsv values.\n\nprint(hsl)\n# Will print off a string representation of the hsl values.\n\nprint(xyz)\n# Will print off a string representation of the xyz values.\n\nprint(ycc)\n# Will print off a string representation of the ycc values.\n\nprint(cmyk)\n# Will print off a string representation of the cmyk values.\n\nprint(hexidecimal)\n# Will print off a string representation of the hexidecimal value\n```\n\u003cbr /\u003e\n\n```py\nGeneratePalette(RGB(100, 100, 100), 'triad')\n# Will generate a palette in the form of a list of colors in the same type of class given using the scheme provided.\n\nInterpolate([RGB(100, 100, 100), RGB(150, 150, 150)])\n# Will interpolate colors that should go in between the ones given and return as a list of RGB objects.\n\nInterpolateFormat([HSV(320, 50, 100), HSV(150, 100, 60)])\n# Will interpolate colors that should go in between the ones given and return a list of color objects similar to the provided ones.\n```\n​\n\u003cbr /\u003e\n\u003cbr /\u003e\n### Code Examples\n```py\nfrom PyColors.Colors import *\n\ncolor = RGB(120, 140, 180)\n\nprint(\"The HSV values for the RGB values of \" + str(color.rgb) + \" are \" + str(color.hsv))\n```\n```py\nfrom PyColors.Colors import *\nfrom PyColors.Palettes import GeneratePalette\n\nmainColor = HSV(320, 50, 100)\nPalette = GeneratePalette(mainColor, \"splitcomplimentary\")\n\nprint(\"Palette: \")\nfor color in Palette: print(color)\n```\n```py\nfrom random import randint\nfrom PyColors.Colors import *\n\nColors = [RGB(randint(0, 255), randint(0, 255), randint(0, 255)) for i in range(10)]\n\nprint(\"Random color RGB values:\")\nfor color in Colors: print(color)\n```\n​\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n## Additional Notes\nThe following are the currently supports schemes for the `GeneratePalette` function:\n- monochromatic\n- analogous\n- complimentary\n- splitcomplimentary\n- tetrad\n- triad\n- random\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firtsa-dev%2Fpycolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firtsa-dev%2Fpycolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firtsa-dev%2Fpycolor/lists"}