{"id":18031739,"url":"https://github.com/dagronf/dsfcolorpicker","last_synced_at":"2026-03-06T19:08:11.815Z","repository":{"id":63907283,"uuid":"164059492","full_name":"dagronf/DSFColorPicker","owner":"dagronf","description":"A color picker for macOS","archived":false,"fork":false,"pushed_at":"2024-07-20T08:24:47.000Z","size":7189,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T04:31:38.584Z","etag":null,"topics":["color","color-picker","color-scheme","macos","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/dagronf.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-04T04:53:13.000Z","updated_at":"2024-08-25T19:12:40.000Z","dependencies_parsed_at":"2024-01-25T23:14:44.748Z","dependency_job_id":"f0e8b4ed-a07f-4c46-b4bb-06ec187f3960","html_url":"https://github.com/dagronf/DSFColorPicker","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"bc21231c86aab2e2872f9099fd2e402ebe6ff308"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFColorPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFColorPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFColorPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFColorPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dagronf","download_url":"https://codeload.github.com/dagronf/DSFColorPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791332,"owners_count":20672665,"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":["color","color-picker","color-scheme","macos","swift"],"created_at":"2024-10-30T10:10:36.847Z","updated_at":"2026-03-06T19:08:11.733Z","avatar_url":"https://github.com/dagronf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSFColorPicker\n\nA Swift library to display a customizable color picker for macOS.\n\n![](https://img.shields.io/github/v/tag/dagronf/DSFColorPicker) ![](https://img.shields.io/badge/macOS-10.12+-red) ![](https://img.shields.io/badge/Swift-5.0-orange.svg)\n![](https://img.shields.io/badge/License-MIT-lightgrey) [![](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)\n\n![](https://dagronf.github.io/art/projects/DSFColorPicker/general.gif)\n\n### Features\n\n* Themable, allow your users to change between provided themes.\n* Configurable color palettes\n* Configurable in Interface Builder or by code.\n* Color picker support to allow selecting a color from the screen\n* Configurable recent colors support\n* Drag and drop support\n\n## Installation\n\nAdd `https://github.com/dagronf/DSFColorPicker` to your project\n\n## Configuration\n\n### SwiftUI\n\nYou can add a `DSFColorPickerUI` to your SwiftUI view to display a DSFColorPicker in your SwiftUI content.\n\nParameters\n\n| Parameter         | Desciption                                             |\n|-------------------|--------------------------------------------------------|\n| `name`            | The name for the picker (eg. 'Stroke color')           |\n| `theme`           | The theme to use, or nil to use the default colors     |\n| `cellSize`        | The size of each color cell                            |\n| `spacing`         | The spacing between each color cell                    |\n| `displaySettings` | The components of the color picker to present          |\n| `selectedColor`   | A binding to the selected color                        |\n\n#### Example\n\n```swift\nstruct MyContent: View {\n   @State var selectedColor: Color = .red\n   var body: some View {\n      ...\n      DSFColorPickerUI(\n         named: \"My color picker\",\n         theme: miniColorTheme,\n         selectedColor: $selectedColor\n      )\n   )\n}\n\nlet miniColorTheme = DSFColorPickerTheme(name: \"Basic Colors\", argbValueGrid: [\n\t[0xF5402C, 0xEB1360, 0x9C1BB1, 0x6634B8, 0x3D4DB7],\n\t[0x47AE4A, 0x009687, 0x01BBD5, 0x00A6F6, 0x0C93F5],\n\t[0x89C43F, 0xCCDD1E, 0xFFEC17, 0xFEC001, 0xFF9800],\n\t[0x000000, 0x5E7C8B, 0x9D9D9D, 0x7A5447, 0xFF5506],\n])\n```\n\n### Interface builder\n\nYou can configure your control in interface builder completely.  Drop in a custom view, change the custom type to DSFColorView (or an overload) and choose your display theme using the 'Named Theme' setting in the custom types\n\n\u003cimg src=\"https://dagronf.github.io/art/projects/DSFColorPicker/interface_builder.png\" alt=\"drawing\" width=\"600\"/\u003e\n\n[Full size](https://dagronf.github.io/art/projects/DSFColorPicker/interface_builder.png)\n\n### In Code\n\nConfigurable using a 2d array of colors, for example \n\n#### A 5x4 grid\n\n\u003cimg src=\"https://dagronf.github.io/art/projects/DSFColorPicker/default.png\" alt=\"drawing\" width=\"200\"/\u003e\n\n[Full size](https://dagronf.github.io/art/projects/DSFColorPicker/default.png)\n\n```swift\n\tlet theme = DSFColorPickerTheme(name: \"My Colors\", argbValueGrid: [\n\t\t[0xF5402C, 0xEB1360, 0x9C1BB1, 0x6634B8, 0x3D4DB7],\n\t\t[0x47AE4A, 0x009687, 0x01BBD5, 0x00A6F6, 0x0C93F5],\n\t\t[0x89C43F, 0xCCDD1E, 0xFFEC17, 0xFEC001, 0xFF9800],\n\t\t[0x000000, 0x5E7C8B, 0x9D9D9D, 0x7A5447, 0xFF5506]]\n\t)\n\tself.colorView.selectedTheme = theme\n```\n\n#### A single row with no recents\n\n\u003cimg src=\"https://dagronf.github.io/art/projects/DSFColorPicker/transparency.png\" alt=\"drawing\" width=\"200\"/\u003e\n\n[Full size](https://dagronf.github.io/art/projects/DSFColorPicker/transparency.png)\n\n```swift\n\tlet theme = DSFColorPickerTheme(name: \"Simple Line\", argbValueGrid: [\n\t\t[0xE0BA4240, 0xE0F0C976, 0xE096A873, 0xE089C9B8, 0xE0AFE6E4, 0xE07AA3C0, 0xE08B719F, 0xE0DB849A]]\n\t)\n\tself.showRecents = false\n\tself.colorView.selectedTheme = theme\n```\n\nThe number of recent colors (if shown) is the same as the number of columns in the color grid\n\n* Show or hide the themes in the control\n* Show or hide the 'selected' button\n* Show or hide recent colors\n* Show or hide titles within the control\n* Set the cell width and height\n* Set the spacing between the color cells\n\n### Color sampling support\n\nAs of macOS 10.15, your app will require Screen Recording permissions to use the color sampler (the eye dropper). \n\nThe first time a user selects the eye-dropper, macOS will display a dialog asking for permission.\n\nYou can view the Screen Recording permissions for apps in the system preferences `Security \u0026 Privacy` pane.\n\n`System Preferences \u003e Security \u0026 Privacy \u003e Privacy \u003e Screen Recording` \n\n### Theme support\n\nSupply a set of themes, and configure the control to display the theme selector.\n\n![](https://dagronf.github.io/art/projects/DSFColorPicker/theme_selector.gif)\n\n### Drag and drop support\n\n* Drag from the picker to any other component (eg. a color well) that supports dropping colors\n* Drag colors into the control\n\n### Dark mode support\n\nAutomatically adjusts to light and dark modes dynamically\n\n### High contrast support\n\nDynamically adjusts to high-contrast display modes\n\n\u003cimg src=\"https://dagronf.github.io/art/projects/DSFColorPicker/popover.png\" alt=\"drawing\" width=\"200\"/\u003e\n\n[Full size](https://dagronf.github.io/art/projects/DSFColorPicker/popover.png)\n\n### Accessibility support (preliminary)\n\n* High contrast support\n* VoiceOver reads out 'named' color views as they are interacted with (\"\u003cname\u003e Color Selector\")\n\n# License\n\n```\nMIT License\n\nCopyright (c) 2024 Darren Ford\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfcolorpicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagronf%2Fdsfcolorpicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfcolorpicker/lists"}