{ "info": { "author": "David Huss", "author_email": "dh@atoav.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# daycolor\n\ndaycolor allows you to choose a (RGB) colors for multiple times of the day and fluidly return HSV-interpolated \"in-between\" colors. The times of the day plus the color may be specified in a a `daycolordict` as shown below. \n\nThis is simply a regular Python dict with strings as indicies. If you need more precision than minutes, you can specify custom patterns.\n\n```python\ndaycolordict = {\n \"01:00\":(255,127,80),\n \"02:00\":(257,34,35),\n \"03:00\":(126,1,0),\n \"10:00\":(126,255,0),\n \"11:00\":(255,244,66),\n \"12:00\":(253,216,161),\n \"18:00\":(27,25,109),\n \"19:00\":(0,0,254),\n \"23:00\":(255,244,66),\n \"23:59\":(253,261,161)\n }\n```\n\nThe `daycolordict` automagically \"wraps around\", that means unless desired there will never be a hard jumps between colors.\n\n\n\nSo for example to get the color for the current time from a dict you could run `get_current()` with your dict as an argument:\n\n```python\nimport daycolor\ndaycolor.get_current(daycolordict)\n```\n\nIf you would rather specify your own time you can do it with the `get_by_datetime()` function:\n\n```python\nimport datetime\n# Get the datetime for a hour into the future\na_hour_in_the_future = datetime.datetime.now() + datetime.timedelta(hours=1)\ndaycolor.get_by_datetime(a_hour_in_the_future, daycolordict)\n```\n\nIf you like to interpolate over the colors in a completely different fashion (e.g. randomly selecting a color that is interpolated between the chosen colors) you can do so by using the `get_by_value()` function:\n\n```python\nimport random\nvalue = random.random()\ndaycolor.get_by_value(value, daycolordict)\n```\n\n## Custom Patterns\n\nIf you would like to get more accuracy in the timedict you could define your daycolors for example as follows:\n\n```python\ndaycolordict = {\n \"00:00.00\":(0,0,0),\n \"00:00.01\":(255,0,0),\n \"00:00.02\":(0,0,0),\n \"00:00.03\":(255,0,0),\n \"00:00.04\":(0,0,0),\n \"00:00.05\":(255,0,0),\n \"00:00.06\":(0,0,0),\n \"00:00.07\":(255,0,0),\n \"00:00.08\":(0,0,0),\n \"00:00.07\":(255,0,0),\n \"00:00.09\":(0,0,0),\n \"12:00.00\":(253,216,161),\n \"23:00.00\":(255,244,66),\n }\n```\n\nThis would return 5 red values every two seconds after midnight and then go black again. To make this wrk you need to call your `get_current()` with a pattern like so:\n\n```python\ndaycolor.get_current(daycolordict, pattern=\"%H:%M.%S\")\n```\n\nIf you wanna see how these patterns are defined, check the [datetime strftime strptime behavior page](https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior). With this you could even achive microsecond precision.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/atoav/daycolor", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "daycolor", "package_url": "https://pypi.org/project/daycolor/", "platform": "", "project_url": "https://pypi.org/project/daycolor/", "project_urls": { "Homepage": "https://github.com/atoav/daycolor" }, "release_url": "https://pypi.org/project/daycolor/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Return a interpolated RGB color depending on the time of the day", "version": "0.0.1" }, "last_serial": 4119534, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "89b6df0a71f058947277c2d5156487d6", "sha256": "238b9889ab20cf006cd0e231dfff70c5caeceaf4ae8a492e983f74da2d9d5958" }, "downloads": -1, "filename": "daycolor-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "89b6df0a71f058947277c2d5156487d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4999, "upload_time": "2018-07-31T09:48:43", "url": "https://files.pythonhosted.org/packages/8d/c2/85b082101ec610e3ddc2e14b828dc66329f9caeb86b2adf21897d8271a9d/daycolor-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c5ee2ff607ce39542c8a8dcc6837c2b", "sha256": "69edf6f015ddef267ef1f423610acb6662d0f0b6af2e05b2a0ba769c529a3180" }, "downloads": -1, "filename": "daycolor-0.0.1.tar.gz", "has_sig": false, "md5_digest": "3c5ee2ff607ce39542c8a8dcc6837c2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4439, "upload_time": "2018-07-31T09:48:44", "url": "https://files.pythonhosted.org/packages/98/18/4104436b509797bcd4b9493fb7e45567e9d17d07c27eaa21ed80153dbcca/daycolor-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "89b6df0a71f058947277c2d5156487d6", "sha256": "238b9889ab20cf006cd0e231dfff70c5caeceaf4ae8a492e983f74da2d9d5958" }, "downloads": -1, "filename": "daycolor-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "89b6df0a71f058947277c2d5156487d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4999, "upload_time": "2018-07-31T09:48:43", "url": "https://files.pythonhosted.org/packages/8d/c2/85b082101ec610e3ddc2e14b828dc66329f9caeb86b2adf21897d8271a9d/daycolor-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c5ee2ff607ce39542c8a8dcc6837c2b", "sha256": "69edf6f015ddef267ef1f423610acb6662d0f0b6af2e05b2a0ba769c529a3180" }, "downloads": -1, "filename": "daycolor-0.0.1.tar.gz", "has_sig": false, "md5_digest": "3c5ee2ff607ce39542c8a8dcc6837c2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4439, "upload_time": "2018-07-31T09:48:44", "url": "https://files.pythonhosted.org/packages/98/18/4104436b509797bcd4b9493fb7e45567e9d17d07c27eaa21ed80153dbcca/daycolor-0.0.1.tar.gz" } ] }