{"id":21819944,"url":"https://github.com/ngageoint/color-ios","last_synced_at":"2025-04-14T02:42:11.796Z","repository":{"id":46322200,"uuid":"512831981","full_name":"ngageoint/color-ios","owner":"ngageoint","description":"Color iOS Library","archived":false,"fork":false,"pushed_at":"2023-11-07T16:36:59.000Z","size":458,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-27T16:41:54.698Z","etag":null,"topics":["cocoapods","color","colors","hex","hex-color","hex-colors","hsl","hsl-color","ios","ios-lib","nga","objective-c","objective-c-library","rgb","rgb-color","rgb-colors","rgba","swift","xcode"],"latest_commit_sha":null,"homepage":"https://ngageoint.github.io/color-ios/","language":"Objective-C","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/ngageoint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-07-11T16:29:55.000Z","updated_at":"2025-03-14T13:38:50.000Z","dependencies_parsed_at":"2023-02-14T12:17:16.314Z","dependency_job_id":null,"html_url":"https://github.com/ngageoint/color-ios","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcolor-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcolor-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcolor-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcolor-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngageoint","download_url":"https://codeload.github.com/ngageoint/color-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812276,"owners_count":21165400,"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":["cocoapods","color","colors","hex","hex-color","hex-colors","hsl","hsl-color","ios","ios-lib","nga","objective-c","objective-c-library","rgb","rgb-color","rgb-colors","rgba","swift","xcode"],"created_at":"2024-11-27T16:27:21.797Z","updated_at":"2025-04-14T02:42:11.760Z","avatar_url":"https://github.com/ngageoint.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Color iOS\n\n#### Color Lib ####\n\nThe Color Library was developed at the [National Geospatial-Intelligence Agency (NGA)](http://www.nga.mil/) in collaboration with [BIT Systems](https://www.caci.com/bit-systems/). The government has \"unlimited rights\" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the [MIT license](http://choosealicense.com/licenses/mit/).\n\n### Pull Requests ###\nIf you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license.\n\nSoftware source code previously released under an open source license and then modified by NGA staff is considered a \"joint work\" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.\n\n### About ###\n\n[Color](http://ngageoint.github.io/color-ios/) is an iOS Objective-C library providing color representation with support for hex, RBG, arithmetic RBG, HSL, and integer colors.\n\n### Usage ###\n\nView the latest [Appledoc](http://ngageoint.github.io/color-ios/docs/api/)\n\n```objectivec\n\nCLRColor *rgb = [CLRColor colorWithRed:154 andGreen:205 andBlue:50];\nCLRColor *rgba = [CLRColor colorWithRed:255 andGreen:165 andBlue:0 andAlpha:64];\nCLRColor *rgbOpacity = [CLRColor colorWithRed:255 andGreen:165 andBlue:0 andOpacity:0.25];\nCLRColor *arithmeticRGB = [CLRColor colorWithArithmeticRed:1.0 andGreen:0.64705882352 andBlue:0.0];\nCLRColor *arithmeticRGBOpacity = [CLRColor colorWithArithmeticRed:1.0 andGreen:0.64705882352 andBlue:0.0 andOpacity:0.25098039215];\nCLRColor *hex = [CLRColor colorWithHex:@\"#BA55D3\"];\nCLRColor *hexAlpha = [CLRColor colorWithHex:@\"#D9FFFF00\"];\nCLRColor *hexInteger = [CLRColor colorWithColor:0xFFC000];\nCLRColor *hexIntegerAlpha = [CLRColor colorWithColor:0x40FFA500];\nCLRColor *integer = [CLRColor colorWithColor:16711680];\nCLRColor *integerAlpha = [CLRColor colorWithColor:-12303292];\nCLRColor *hexSingles = [CLRColor colorWithHexRed:@\"FF\" andGreen:@\"C0\" andBlue:@\"CB\"];\nCLRColor *hexSinglesAlpha = [CLRColor colorWithHexRed:@\"00\" andGreen:@\"00\" andBlue:@\"00\" andAlpha:@\"80\"];\nCLRColor *hexSinglesOpacity = [CLRColor colorWithHexRed:@\"FF\" andGreen:@\"A5\" andBlue:@\"00\" andOpacity:0.25];\nCLRColor *hsl = [CLRColor colorWithHue:300.0 andSaturation:1.0 andLightness:0.2509804];\nCLRColor *hsla = [CLRColor colorWithHue:60.0 andSaturation:1.0 andLightness:0.5 andAlpha:0.85098039215];\nCLRColor *orangeAlpha = [CLRColor colorWithHex:CLR_COLOR_ORANGE andAlpha:120];\nCLRColor *orangeOpacity = [CLRColor colorWithHex:CLR_COLOR_ORANGE andOpacity:0.25];\n\nCLRColor *color = [CLRColor blue];\n[color setAlpha:56];\nNSString *hexValue = [color colorHex];\nNSString *hexShorthand = [color colorHexShorthand];\nNSString *hexWithAlpha = [color colorHexWithAlpha];\nNSString *hexShorthandWithAlpha = [color colorHexShorthandWithAlpha];\nint integerValue = [color color];\nint integerAlphaValue = [color colorWithAlpha];\nint red = [color red];\nfloat greenArithmetic = color.greenArithmetic;\nNSString *blueHex = [color blueHex];\nNSString *alphaHexShorthand = [color alphaHexShorthand];\nfloat opacity = color.opacity;\nfloat *hslValue = [color hsl];\nfloat hue = [color hue];\nfloat saturation = [color saturation];\nfloat lightness = [color lightness];\n\n```\n\n### Build ###\n\n[![Build \u0026 Test](https://github.com/ngageoint/color-ios/workflows/Build%20\u0026%20Test/badge.svg)](https://github.com/ngageoint/color-ios/actions/workflows/build-test.yml)\n\nBuild this repository using Xcode and/or CocoaPods:\n\n    pod install\n\nOpen color-ios.xcworkspace in Xcode or build from command line:\n\n    xcodebuild -workspace 'color-ios.xcworkspace' -scheme color-ios build\n\nRun tests from Xcode or from command line:\n\n    xcodebuild test -workspace 'color-ios.xcworkspace' -scheme color-ios -destination 'platform=iOS Simulator,name=iPhone 15'\n\n### Include Library ###\n\nInclude this repository by specifying it in a Podfile using a supported option.\n\nPull from [CocoaPods](https://cocoapods.org/pods/color-ios):\n\n    pod 'color-ios', '~\u003e 1.0.2'\n\nPull from GitHub:\n\n    pod 'color-ios', :git =\u003e 'https://github.com/ngageoint/color-ios.git', :branch =\u003e 'master'\n    pod 'color-ios', :git =\u003e 'https://github.com/ngageoint/color-ios.git', :tag =\u003e '1.0.2'\n\nInclude as local project:\n\n    pod 'color-ios', :path =\u003e '../color-ios'\n\n### Swift ###\n\nTo use from Swift, import the color-ios bridging header from the Swift project's bridging header\n\n    #import \"color-ios-Bridging-Header.h\"\n\n```swift\n\nlet rgb : CLRColor = CLRColor.init(red:154, andGreen:205, andBlue:50)\nlet rgba : CLRColor = CLRColor.init(red:255, andGreen:165, andBlue:0, andAlpha:64)\nlet rgbOpacity : CLRColor = CLRColor.init(red:255, andGreen:165, andBlue:0, andOpacity:0.25)\nlet arithmeticRGB : CLRColor = CLRColor.init(arithmeticRed:1.0, andGreen:0.64705882352, andBlue:0.0)\nlet arithmeticRGBOpacity : CLRColor = CLRColor.init(arithmeticRed:1.0, andGreen:0.64705882352, andBlue:0.0, andOpacity:0.25098039215)\nlet hex : CLRColor = CLRColor.init(hex:\"#BA55D3\")\nlet hexAlpha : CLRColor = CLRColor.init(hex:\"#D9FFFF00\")\nlet hexInteger : CLRColor = CLRColor.init(color:0xFFC000)\nlet hexIntegerAlpha : CLRColor = CLRColor.init(color:0x40FFA500)\nlet integer : CLRColor = CLRColor.init(color:16711680)\nlet integerAlpha : CLRColor = CLRColor.init(color:-12303292)\nlet hexSingles : CLRColor = CLRColor.init(hexRed:\"FF\", andGreen:\"C0\", andBlue:\"CB\")\nlet hexSinglesAlpha : CLRColor = CLRColor.init(hexRed:\"00\", andGreen:\"00\", andBlue:\"00\", andAlpha:\"80\")\nlet hexSinglesOpacity : CLRColor = CLRColor.init(hexRed:\"FF\", andGreen:\"A5\", andBlue:\"00\", andOpacity:0.25)\nlet hsl : CLRColor = CLRColor.init(hue:300.0, andSaturation:1.0, andLightness:0.2509804)\nlet hsla : CLRColor = CLRColor.init(hue:60.0, andSaturation:1.0, andLightness:0.5, andAlpha:0.85098039215)\nlet orangeAlpha : CLRColor = CLRColor.init(hex:CLR_COLOR_ORANGE, andAlpha:120)\nlet orangeOpacity : CLRColor = CLRColor.init(hex:CLR_COLOR_ORANGE, andOpacity:0.25)\n\nlet color : CLRColor = CLRColor.blue()\ncolor.setAlpha(56)\nlet hexValue : String = color.colorHex()\nlet hexShorthand : String = color.colorHexShorthand()\nlet hexWithAlpha : String = color.colorHexWithAlpha()\nlet hexShorthandWithAlpha : String = color.colorHexShorthandWithAlpha()\nlet integerValue : Int32 = color.color()\nlet integerAlphaValue : Int32 = color.colorWithAlpha()\nlet red : Int32 = color.red()\nlet greenArithmetic : Float = color.greenArithmetic\nlet blueHex : String = color.blueHex()\nlet alphaHexShorthand : String = color.alphaHexShorthand()\nlet opacity : Float = color.opacity\nlet hslValue : UnsafeMutablePointer\u003cFloat\u003e = color.hsl()\nlet hue : Float = color.hue()\nlet saturation : Float = color.saturation()\nlet lightness : Float = color.lightness()\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Fcolor-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngageoint%2Fcolor-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Fcolor-ios/lists"}