{"id":21383313,"url":"https://github.com/emnasc/solid-color-api","last_synced_at":"2026-04-19T05:37:15.746Z","repository":{"id":166224117,"uuid":"277152030","full_name":"emnasc/solid-color-api","owner":"emnasc","description":"Simple API to generate solid color images","archived":false,"fork":false,"pushed_at":"2020-09-12T20:15:39.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T11:30:35.973Z","etag":null,"topics":["api","api-rest","flask","images","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emnasc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-07-04T17:03:22.000Z","updated_at":"2020-09-12T20:15:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e084ec4-d265-48f8-b2ed-deaead184067","html_url":"https://github.com/emnasc/solid-color-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emnasc/solid-color-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emnasc%2Fsolid-color-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emnasc%2Fsolid-color-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emnasc%2Fsolid-color-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emnasc%2Fsolid-color-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emnasc","download_url":"https://codeload.github.com/emnasc/solid-color-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emnasc%2Fsolid-color-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268256714,"owners_count":24221046,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","api-rest","flask","images","python"],"created_at":"2024-11-22T11:27:48.783Z","updated_at":"2026-04-19T05:37:15.717Z","avatar_url":"https://github.com/emnasc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solid Color API\n\nThis project is a simple Flask API to generate solid color images based on given parameters\n\n## Project environemnt and setup\nThis project is built on top a Pipenv virtual environment, based on a Python 3.6.0 interpreter. The environment can be setup using the following commands:\n\n``` shell script\npip install pipenv #in case you already have pipenv installed, this line can be skipped\npipenv shell\n```\n\nThis project uses [Flask](https://flask.palletsprojects.com/en/1.1.x/) and [Python Imaging Library (PIL)](http://www.pythonware.com/products/pil/) as it's dependencies, asside from `BytesIO` and `re` from Python's standard library.\n\n## Running the project\nThis project can be run as a simple Python script, as follows:\n```shell script\npython app.py\n```\n\n## Calling the API\nThe API accepts GET requests, requiring three parameters decribing the image to be generated:\n+ the image's width, as `width`\n+ the image's height, as `height`\n+ an hexadecimal code of either length 3 or 6 corresponding to the desired color, as `hex-color`\n\nIf any of those parameters is not provided, the API will return a `400` error with a message indicating the missing parameter\n```shell script\ncurl --location --request GET 'http://127.0.0.1:5000/?width=400hex-color=5F4B8B'\n```\n\u003e Height not provided\n\nOtherwise, the script will return a solid color JPEG image corresponding to the given parameters\n ```shell script\ncurl --location --request GET 'http://127.0.0.1:5000/?width=150\u0026height=200\u0026hex-color=888'\n```\n\u003e ![Sample Image](./solid_color_sample_image.jpg)\n\nOtherwise, the API will returns a `500` status code with either a appropriate custom message or an error description\n```shell script\ncurl --location --request GET 'http://127.0.0.1:5000/?width=150\u0026height=200\u0026hex-color=potato'\n```\n\u003e Error: Invalid hex code: potato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femnasc%2Fsolid-color-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femnasc%2Fsolid-color-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femnasc%2Fsolid-color-api/lists"}