{"id":21846593,"url":"https://github.com/binarybirds/sunlight","last_synced_at":"2025-04-14T13:23:06.441Z","repository":{"id":62326441,"uuid":"170206885","full_name":"BinaryBirds/Sunlight","owner":"BinaryBirds","description":"Calculate dawn, dusk, golden and blue hour times by using various algorithms.","archived":false,"fork":false,"pushed_at":"2022-02-17T15:19:05.000Z","size":7,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-05T23:15:06.618Z","etag":null,"topics":["calculator","celestial","dawn","dusk","sunrise","sunset","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"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/BinaryBirds.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":"2019-02-11T21:41:50.000Z","updated_at":"2025-02-05T14:04:11.000Z","dependencies_parsed_at":"2022-10-30T20:45:40.481Z","dependency_job_id":null,"html_url":"https://github.com/BinaryBirds/Sunlight","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBirds%2FSunlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBirds%2FSunlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBirds%2FSunlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBirds%2FSunlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryBirds","download_url":"https://codeload.github.com/BinaryBirds/Sunlight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886799,"owners_count":21177748,"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":["calculator","celestial","dawn","dusk","sunrise","sunset","swift"],"created_at":"2024-11-27T23:14:39.869Z","updated_at":"2025-04-14T13:23:06.412Z","avatar_url":"https://github.com/BinaryBirds.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sunlight (☀️)\n\nCalculate dawn, dusk, golden and blue hour times by using various algorithms.\n\n\n\n### Twilight Types\n\n![](https://www.photopills.com/sites/default/files/tutorials/2014/twilights-magic-hours.jpg)\n\n\n\n- Civil Twilight\n- Nautical Twilight\n- Astronomical Twilight\n- Dawn (official)\n- Dusk (official)\n- The Golden Hour\n- The Blue Hour\n\n\n\n## Usage\n\nSome examples:\n\n```swift\nimport Sunlight\n\nlet sunlight = SunlightCalculator(latitude: 47.49801, longitude: 19.03991)\n        \nlet officialDawn = sunlight.calculate(.dawn, twilight: .official)\nlet officialDusk = sunlight.calculate(.dusk, twilight: .official)\n\nlet civilDawn = sunlight.calculate(.dawn, twilight: .civil)\nlet civilDusk = sunlight.calculate(.dusk, twilight: .civil)\n\nlet astronomicalDawn = sunlight.calculate(.dawn, twilight: .astronomical)\nlet astronomicalDusk = sunlight.calculate(.dusk, twilight: .astronomical)\n\nlet nauticalDawn = sunlight.calculate(.dawn, twilight: .nautical)\nlet nauticalDusk = sunlight.calculate(.dusk, twilight: .nautical)\n\nlet blueHourStart = sunlight.calculate(.dawn, twilight: .custom(-8))\nlet blueHourEndGoldenHourStart = sunlight.calculate(.dusk, twilight: .custom(-4))\nlet goldenHourEnd = sunlight.calculate(.dusk, twilight: .custom(6))\n\n```\n\n\n\n## Install\n\nJust use the [Swift Package Manager](https://theswiftdev.com/2017/11/09/swift-package-manager-tutorial/) as usual:\n\n```swift\n.package(url: \"https://github.com/binarybirds/sunlight\", from: \"1.0.0\"),\n```\n\n⚠️ Don't forget to add \"Sunlight\" to your target as a dependency!\n\n\n\n## License\n\n[WTFPL](LICENSE) - Do what the fuck you want to.\n\n\n\n## Other sources\n\n- https://en.wikipedia.org/wiki/Position_of_the_Sun \n- https://en.wikipedia.org/wiki/Sunrise_equation \n\n- https://www.codeproject.com/Articles/100174/Calculate-and-Draw-Moon-Phase \n\n- http://lamminet.fi/jarmo/rscalc.cc \n\n- https://www.timeanddate.com/astronomy/different-types-twilight.html \n\n- https://www.photopills.com/articles/understanding-golden-hour-blue-hour-and-twilights\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarybirds%2Fsunlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarybirds%2Fsunlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarybirds%2Fsunlight/lists"}