# HueForge
## A python library to handle everything color related.
This is a python library that handles everything color related. It includes a color class.
Valid ways to initialize an object:
```python
from hueforge import Color
# Valid ways to initialize:
example_color = Color("#FF0000") # Hex color format
example_color = Color("#FF0000FF") # Hexa color format
example_color = Color("Orange red") # Direct color format
example_color = Color((255, 0, 0)) # RGB color format
example_color = Color((255, 0, 0, 255)) # RGBA color format
example_color = Color((0, 0)) # Invalid color format; Raises exception
```
Get a color in a specific format from a Color() instance:
```python
from hueforge import Color
example_color = Color("#FF0000")
print(example_color.hex()) # Outputs: "#FF0000"
print(example_color.hexa()) # Outputs: "#FF0000FF"
print(example_color.rgb()) # Outputs: (255, 0, 0)
print(example_color.rgba()) # Outputs: (255, 0, 0, 255)
print(example_color.direct()) # Outputs: "red"
# Note: example_color.direct() will raise a exception if the color
# is too unique and doesn't have a set name.
```
Adjust brightness, contrast, hue and saturation.
```python
from hueforge import Color
example_color = Color("#99ABD3")
# Note: These methods don't modify the color in
# place, They return a new color instead.
print(example_color.increase_brightness(40)) # Increase brightness by 40%
print(example_color.increase_contrast(70)) # Increase contrast by 70%
print(example_color.increase_hue(180)) # Increase hue by 180 degrees (0 - 360)
print(example_color.increase_saturation(100)) # Increase Saturation by 100%
# You can also use decrease_brightness, decrease_contrast etc.
```
Simulate colorblindness and help colorblindness.
```python
from hueforge import Color
example_color = Color("#FF0000")
colorblindness = "protanopia" # Type of colorblindness. Possible values: deuteranopia, deuteranomaly, protanopia, protanomaly, tritanopia, tritanomaly, all, d, t, p, d1, t1, p1, d2, t2, p2, a (all)
print(f"A colorblind person would see this as: {example_color.simulate_colorblindness(colorblindness)}")
print(f"Adjusted color so the colorblind person can see the color properly: {example_color.help_colorblindness(colorblindness)}")
```
Generate a smooth color gradient starting from one color, Ending with the other:
```python
from hueforge import Color
starting_color = Color("#FF0000")
ending_color = Color("#0000FF")
gradient = starting_color.gradient(ending_color, steps=3)
print(gradient) # Outputs: [Color(#FF0000), Color(#7F007F), Color(#0000FF)]
# Increase steps for a higher quality gradient, It's recommended to keep it under 255.
# By higher quality, I mean that there are more unique colors leading to a smoother gradient. For example, a 2 step gradient would just be [starting_color, end_color]. Such a gradient is useless because of the low quality.
high_quality_gradient = starting_color.gradient(ending_color, steps=5)
print(high_quality_gradient) # Outputs: [Color(#FF0000), Color(#BF003F), Color(#7F007F), Color(#3F00BF), Color(#0000FF)]
```
Color Harmonies:
```python
from hueforge import Color
example_color = Color("#FF0000")
print(example_color.get_complementary_color())
print(example_color.get_split_complementary_colors())
print(example_color.get_analogous_colors())
print(example_color.get_triadic_colors())
print(example_color.get_tetradic_colors())
print(example_color.get_square_colors())
# Hover over these functions (in an IDE) to see their return order.
```
Blending colors
```python
from hueforge import Color
color1 = Color("#FF0000")
color2 = Color("#FFFF00")
print(color1.blend(color2)) # Gives a 50/50 mix of color1 and color2
print(color1.blend(color2, delta=0)) # Gives color1
print(color1.blend(color2, delta=70)) # Gives a 70/30 mix of color1 and color2
print(color1.blend(color2, delta=100)) # Gives color2
```
Inverting colors
```python
from hueforge import Color
example_color = Color("#FF0000")
print(example_color.invert())
```
Temperature control
```python
from hueforge import Color
example_color = Color("#FF0000")
print(example_color.temperature(100)) # 100 = extremely hot temperature, 0 = extremely cold temperature
```
That's almost everything that's included in this library. Thanks for using HueForge!
Raw data
{
"_id": null,
"home_page": null,
"name": "hueforge",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, color, engine, colorengine, hue, contrast, saturation, hueforge, manager",
"author": "Schkimansky",
"author_email": "<ahmadchawla1432@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/70/fb/d78c566e26856ab2c58a957c38f5853f8f89046807d6b0ba617bc21b6384/hueforge-1.31.tar.gz",
"platform": null,
"description": "\n# HueForge\n## A python library to handle everything color related.\n\nThis is a python library that handles everything color related. It includes a color class. \nValid ways to initialize an object:\n\n```python\nfrom hueforge import Color\n\n# Valid ways to initialize:\nexample_color = Color(\"#FF0000\") # Hex color format \nexample_color = Color(\"#FF0000FF\") # Hexa color format \nexample_color = Color(\"Orange red\") # Direct color format \nexample_color = Color((255, 0, 0)) # RGB color format \nexample_color = Color((255, 0, 0, 255)) # RGBA color format \nexample_color = Color((0, 0)) # Invalid color format; Raises exception \n```\n\nGet a color in a specific format from a Color() instance:\n```python\nfrom hueforge import Color\n\nexample_color = Color(\"#FF0000\")\n\nprint(example_color.hex()) # Outputs: \"#FF0000\"\nprint(example_color.hexa()) # Outputs: \"#FF0000FF\"\nprint(example_color.rgb()) # Outputs: (255, 0, 0)\nprint(example_color.rgba()) # Outputs: (255, 0, 0, 255)\nprint(example_color.direct()) # Outputs: \"red\"\n\n# Note: example_color.direct() will raise a exception if the color\n# is too unique and doesn't have a set name.\n```\n\nAdjust brightness, contrast, hue and saturation.\n```python\nfrom hueforge import Color\n\nexample_color = Color(\"#99ABD3\")\n\n# Note: These methods don't modify the color in \n# place, They return a new color instead.\n\nprint(example_color.increase_brightness(40)) # Increase brightness by 40%\nprint(example_color.increase_contrast(70)) # Increase contrast by 70%\nprint(example_color.increase_hue(180)) # Increase hue by 180 degrees (0 - 360)\nprint(example_color.increase_saturation(100)) # Increase Saturation by 100%\n\n# You can also use decrease_brightness, decrease_contrast etc.\n```\n\nSimulate colorblindness and help colorblindness.\n```python\nfrom hueforge import Color\n\nexample_color = Color(\"#FF0000\")\ncolorblindness = \"protanopia\" # Type of colorblindness. Possible values: deuteranopia, deuteranomaly, protanopia, protanomaly, tritanopia, tritanomaly, all, d, t, p, d1, t1, p1, d2, t2, p2, a (all)\n\nprint(f\"A colorblind person would see this as: {example_color.simulate_colorblindness(colorblindness)}\")\nprint(f\"Adjusted color so the colorblind person can see the color properly: {example_color.help_colorblindness(colorblindness)}\")\n```\n\nGenerate a smooth color gradient starting from one color, Ending with the other:\n```python\nfrom hueforge import Color\n\nstarting_color = Color(\"#FF0000\")\nending_color = Color(\"#0000FF\")\n\ngradient = starting_color.gradient(ending_color, steps=3)\nprint(gradient) # Outputs: [Color(#FF0000), Color(#7F007F), Color(#0000FF)]\n\n# Increase steps for a higher quality gradient, It's recommended to keep it under 255.\n# By higher quality, I mean that there are more unique colors leading to a smoother gradient. For example, a 2 step gradient would just be [starting_color, end_color]. Such a gradient is useless because of the low quality. \nhigh_quality_gradient = starting_color.gradient(ending_color, steps=5)\nprint(high_quality_gradient) # Outputs: [Color(#FF0000), Color(#BF003F), Color(#7F007F), Color(#3F00BF), Color(#0000FF)]\n```\n\nColor Harmonies:\n```python\nfrom hueforge import Color\n\nexample_color = Color(\"#FF0000\")\nprint(example_color.get_complementary_color())\nprint(example_color.get_split_complementary_colors())\nprint(example_color.get_analogous_colors())\nprint(example_color.get_triadic_colors())\nprint(example_color.get_tetradic_colors())\nprint(example_color.get_square_colors())\n\n# Hover over these functions (in an IDE) to see their return order.\n```\n\nBlending colors\n```python\nfrom hueforge import Color\n\ncolor1 = Color(\"#FF0000\")\ncolor2 = Color(\"#FFFF00\")\nprint(color1.blend(color2)) # Gives a 50/50 mix of color1 and color2\nprint(color1.blend(color2, delta=0)) # Gives color1\nprint(color1.blend(color2, delta=70)) # Gives a 70/30 mix of color1 and color2\nprint(color1.blend(color2, delta=100)) # Gives color2\n```\n\nInverting colors\n```python\nfrom hueforge import Color\n\nexample_color = Color(\"#FF0000\")\nprint(example_color.invert())\n```\n\nTemperature control\n```python\nfrom hueforge import Color\n\nexample_color = Color(\"#FF0000\")\nprint(example_color.temperature(100)) # 100 = extremely hot temperature, 0 = extremely cold temperature\n```\n\nThat's almost everything that's included in this library. Thanks for using HueForge!\n",
"bugtrack_url": null,
"license": null,
"summary": "Python color engine.",
"version": "1.31",
"project_urls": null,
"split_keywords": [
"python",
" color",
" engine",
" colorengine",
" hue",
" contrast",
" saturation",
" hueforge",
" manager"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a65cf58906213c1d2ba35a3f622f33845d11727698e006fb8f2705f008668674",
"md5": "91538edd910f46e1897b6f305d624cce",
"sha256": "e3f7f62c9e222c3ec2104edcce0110254e5f15ba35c586137bd54825a146f1b7"
},
"downloads": -1,
"filename": "hueforge-1.31-py3-none-any.whl",
"has_sig": false,
"md5_digest": "91538edd910f46e1897b6f305d624cce",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10735,
"upload_time": "2024-11-28T19:15:55",
"upload_time_iso_8601": "2024-11-28T19:15:55.448424Z",
"url": "https://files.pythonhosted.org/packages/a6/5c/f58906213c1d2ba35a3f622f33845d11727698e006fb8f2705f008668674/hueforge-1.31-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "70fbd78c566e26856ab2c58a957c38f5853f8f89046807d6b0ba617bc21b6384",
"md5": "4336c39e36a661d17c32ecbfdaf8a694",
"sha256": "11ac5d58adaf9245f68631854f27e55ecb0895002dcdce2e2fe5960fbe14f753"
},
"downloads": -1,
"filename": "hueforge-1.31.tar.gz",
"has_sig": false,
"md5_digest": "4336c39e36a661d17c32ecbfdaf8a694",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10405,
"upload_time": "2024-11-28T19:15:57",
"upload_time_iso_8601": "2024-11-28T19:15:57.433297Z",
"url": "https://files.pythonhosted.org/packages/70/fb/d78c566e26856ab2c58a957c38f5853f8f89046807d6b0ba617bc21b6384/hueforge-1.31.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-28 19:15:57",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "hueforge"
}