{"id":13751708,"url":"https://github.com/workingDog/SwiftUIColorSlider","last_synced_at":"2025-05-09T18:31:57.086Z","repository":{"id":151934881,"uuid":"203276655","full_name":"workingDog/SwiftUIColorSlider","owner":"workingDog","description":"SwiftUI ColorSlider view","archived":false,"fork":false,"pushed_at":"2020-02-10T23:24:30.000Z","size":1370,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-20T15:33:50.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/workingDog.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":"2019-08-20T01:28:53.000Z","updated_at":"2024-09-07T12:13:59.000Z","dependencies_parsed_at":"2023-05-16T16:30:50.530Z","dependency_job_id":null,"html_url":"https://github.com/workingDog/SwiftUIColorSlider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FSwiftUIColorSlider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FSwiftUIColorSlider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FSwiftUIColorSlider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FSwiftUIColorSlider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workingDog","download_url":"https://codeload.github.com/workingDog/SwiftUIColorSlider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253303034,"owners_count":21886875,"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":[],"created_at":"2024-08-03T09:00:52.667Z","updated_at":"2025-05-09T18:31:55.912Z","avatar_url":"https://github.com/workingDog.png","language":"Swift","funding_links":[],"categories":["🌎 by the community"],"sub_categories":[],"readme":"\n# SwiftUI ColorSlider\n\n\n ![im01](image01.png)  ![im02](image02.png) \n\n\n**ColorSlider** is a SwiftUI view that displays a color slider.\nIt is used to dynamically select a color from a range of colors or grayscale.\n\nThe main elements are **ColorSlider.swift** and **ColorObject.swift**, see the demo in **ContenView.swift** for how to use it in your code.\n\nThe key to using this *ColorSlider* in your code is to create a **ColorObject** such as:\n\n    @ObservedObject var colorObject = ColorObject()\n\nand pass it to the *ColorSlider* as shown in *ContenView.swift*,\n\n    ColorSlider(colorObject: colorObject, width: 300, height: 40)\n    \nAs the slider knob is changed, the current color selected can be obtain from the **ColorObject** using:\n    \n    colorObject.color\n    \nThe following can be set to customise the **ColorObject** and thus the **ColorSlider**:\n\n- nColors, the number of colors to display in the slider, default 100.\n- saturation, the desired saturation value, default 1.\n- brightness, the desired brightness value, default 1.\n- isDraggable, to allow the slider to be dragged around the screen, default true\n- bandSize, to set the thichness of the color bands in the slider, default 1.\n\n**ColorSlider** will display a slider gradient of colors, from white to black.\n\nFor convenience, to display a gray scale slider, initialise the  **ColorObject** as:\n\n    @ObservedObject var colorObject = ColorObject(grayScale: true)\n    \nFor convenience, to display a static slider, initialise the  **ColorObject** as:\n\n    @ObservedObject var colorObject = ColorObject(isDraggable: false)    \n\n## Example of vertical sliders\n\nFor a vertical slider just add: \n\n    .rotationEffect(.degrees(90))\n\nThe color slider on the left is with the default settings.\n\nThe color slider on the right has nColors=10, and a color bandSize=10\n\n\n![im01](v1.png)  ![im01](v2.png) \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FworkingDog%2FSwiftUIColorSlider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FworkingDog%2FSwiftUIColorSlider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FworkingDog%2FSwiftUIColorSlider/lists"}