{"id":19415269,"url":"https://github.com/jakeroggenbuck/colorgradient-rs","last_synced_at":"2026-06-17T17:32:06.097Z","repository":{"id":47610593,"uuid":"363345967","full_name":"JakeRoggenbuck/colorgradient-rs","owner":"JakeRoggenbuck","description":"Generate a gradient from selected colors","archived":false,"fork":false,"pushed_at":"2023-01-01T07:31:27.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T03:13:50.521Z","etag":null,"topics":["color-scheme","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/JakeRoggenbuck.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}},"created_at":"2021-05-01T07:04:40.000Z","updated_at":"2022-06-18T22:18:39.000Z","dependencies_parsed_at":"2023-01-31T21:01:47.096Z","dependency_job_id":null,"html_url":"https://github.com/JakeRoggenbuck/colorgradient-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JakeRoggenbuck/colorgradient-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeRoggenbuck%2Fcolorgradient-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeRoggenbuck%2Fcolorgradient-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeRoggenbuck%2Fcolorgradient-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeRoggenbuck%2Fcolorgradient-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JakeRoggenbuck","download_url":"https://codeload.github.com/JakeRoggenbuck/colorgradient-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeRoggenbuck%2Fcolorgradient-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34459380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":["color-scheme","rust","rust-lang"],"created_at":"2024-11-10T12:42:26.484Z","updated_at":"2026-06-17T17:32:06.082Z","avatar_url":"https://github.com/JakeRoggenbuck.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# colorgradient-rs\n![image](https://user-images.githubusercontent.com/35516367/116793337-1716c680-aa7b-11eb-9c1e-2cda170e2118.png)\n\n- Python version [colorgradient](https://github.com/JakeRoggenbuck/colorgradient)\n- Rust version [colorgradient-rs](https://github.com/JakeRoggenbuck/colorgradient-rs)\n- Julia version [colorgradient-julia](https://github.com/JakeRoggenbuck/colorgradient-julia)\n- C version [colorgradient-c](https://github.com/JakeRoggenbuck/colorgradient-c)\n- Go version [colorgradient-go](https://github.com/JakeRoggenbuck/colorgradient-go)\n- Clojure version [colorgradient-clj](https://github.com/JakeRoggenbuck/colorgradient-clj)\n\n\u003cimg width=\"400\" alt=\"color grad\" src=\"https://user-images.githubusercontent.com/35516367/210163818-5f286e55-9b2a-431c-a397-c1a24a37dbb1.png\"\u003e\n\n# Install \n```\ngit clone https://github.com/JakeRoggenbuck/colorgradient-rs\ncargo install --path colorgradient-rs\n```\n\n# Test\n```\ncargo test\n```\n\n# Code\n```rs\nfn calculate_gradient(num: i64, original_colors: Vec\u003cRGB\u003e) -\u003e Vec\u003cRGB\u003e {\n    // Get the needed step value to fit the num of iterations in the original_colors length\n    let step: f32 = (original_colors.len() as f32 - 1.0) / num as f32;\n    let channels = get_channels(original_colors);\n    let mut colors = Vec::\u003cRGB\u003e::new();\n\n    for i in 0..num {\n        // Use step to count up with index\n        let x: f32 = i as f32 * step;\n        let mut color = Vec::new();\n        // Get each channel as a reference, use it as the known x values\n        for channel in [\u0026channels.red, \u0026channels.green, \u0026channels.blue].iter() {\n            // Add the y values found from the x value to the color\n            color.push(find_y(x as f32, channel).abs());\n        }\n        // Change the vector of colors to RGB structure, and add it to all the colors\n        colors.push(vec_to_rgb!(color));\n    }\n    return colors;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakeroggenbuck%2Fcolorgradient-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakeroggenbuck%2Fcolorgradient-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakeroggenbuck%2Fcolorgradient-rs/lists"}