From 6f549381b61126a6f620ba39ab35b2128a4a15fe Mon Sep 17 00:00:00 2001 From: Chandan Date: Tue, 21 Oct 2025 22:34:27 +0530 Subject: [PATCH] Rename to ColorsKit across package, module, docs, and scripts; update podspec module_name and URLs; keep version at 0.1.2 --- CONTRIBUTING.md | 2 +- ColorsKit.podspec | 10 +-- Documentation/APIReference.md | 6 +- Documentation/GettingStarted.md | 18 +++-- Example/ConsumerSample/Package.swift | 2 +- .../ConsumerSample/ConsumerSample.swift | 2 +- Example/iOSAppDemo/README.md | 8 +-- Package.swift | 12 ++-- README.md | 70 +++---------------- Scripts/automate_package.sh | 24 +++---- .../ColorsKit.swift} | 0 Tests/UnitTests/HexAndContrastTests.swift | 2 +- 12 files changed, 51 insertions(+), 105 deletions(-) rename Sources/{ColorKit/ColorKit.swift => ColorsKit/ColorsKit.swift} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7902564..9a1ada2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to ColorKit +# Contributing to ColorsKit Thanks for considering a contribution! This project welcomes issues and pull requests. diff --git a/ColorsKit.podspec b/ColorsKit.podspec index d1f8d85..a3a56fe 100644 --- a/ColorsKit.podspec +++ b/ColorsKit.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.version = '0.1.2' s.summary = 'Comprehensive color management for iOS: hex APIs, theming, accessibility, gradients.' s.description = <<-DESC -ColorKit simplifies color usage in iOS apps by providing: +ColorsKit simplifies color usage in iOS apps by providing: - Hex parsing/formatting - UIKit/SwiftUI extensions - Dynamic theming with dark/light adaptation @@ -11,15 +11,15 @@ ColorKit simplifies color usage in iOS apps by providing: - Palette generators and gradient builders - Color-blindness simulation tools DESC - s.homepage = 'https://github.com/ckdash-git/ColorKit' + s.homepage = 'https://github.com/ckdash-git/ColorsKit' s.license = { :type => 'Apache-2.0', :file => 'LICENSE' } s.author = { 'Chandan Kumar Dash' => 'chandan@optionallabs.com' } - s.source = { :git => 'https://github.com/ckdash-git/ColorKit.git', :tag => s.version.to_s } + s.source = { :git => 'https://github.com/ckdash-git/ColorsKit.git', :tag => s.version.to_s } s.swift_version = '5.9' s.ios.deployment_target = '13.0' s.osx.deployment_target = '12.0' s.source_files = 'Sources/**/*.{swift}' s.requires_arc = true - s.module_name = 'ColorKit' - s.documentation_url = 'https://github.com/ckdash-git/ColorKit#readme' + s.module_name = 'ColorsKit' + s.documentation_url = 'https://github.com/ckdash-git/ColorsKit#readme' end \ No newline at end of file diff --git a/Documentation/APIReference.md b/Documentation/APIReference.md index b0e65a5..1319594 100644 --- a/Documentation/APIReference.md +++ b/Documentation/APIReference.md @@ -1,9 +1,9 @@ -# ColorKit API Reference +# ColorsKit API Reference -This document provides a high-level overview of the ColorKit modules and key types. +This document provides a high-level overview of the ColorsKit modules and key types. - Platforms: iOS 13+, macOS 12+, tvOS 13+, watchOS 6+ -- Repo: `https://github.com/ckdash-git/ColorKit.git` +- Repo: `https://github.com/ckdash-git/ColorsKit.git` ## Modules diff --git a/Documentation/GettingStarted.md b/Documentation/GettingStarted.md index a718b09..98b6706 100644 --- a/Documentation/GettingStarted.md +++ b/Documentation/GettingStarted.md @@ -1,6 +1,6 @@ -# Getting Started with ColorKit +# Getting Started with ColorsKit -ColorKit simplifies color management in iOS apps by providing: +ColorsKit simplifies color management in iOS apps by providing: - Hex-based color creation for UIKit and SwiftUI - Dynamic theming and dark/light auto-adaptation - Accessibility contrast checking @@ -12,24 +12,24 @@ ColorKit simplifies color management in iOS apps by providing: ### Swift Package Manager Use the GitHub URL and a tagged version in Xcode or `Package.swift`. -- URL: `https://github.com/ckdash-git/ColorKit.git` +- URL: `https://github.com/ckdash-git/ColorsKit.git` - Example `Package.swift`: ```swift .dependencies: [ - .package(url: "https://github.com/ckdash-git/ColorKit.git", from: "0.1.2") + .package(url: "https://github.com/ckdash-git/ColorsKit.git", from: "0.1.2") ] .targets: [ .target( name: "App", dependencies: [ - .product(name: "ColorKit", package: "ColorKit") + .product(name: "ColorsKit", package: "ColorsKit") ] ) ] ``` -In Xcode: File → Add Packages… → paste the URL → select the `ColorKit` product. +In Xcode: File → Add Packages… → paste the URL → select the `ColorsKit` product. ### CocoaPods Install via CocoaPods using the published pod `ColorsKit`: @@ -46,15 +46,13 @@ end Then run `pod install` and import the module in your code: ```swift -import ColorKit +import ColorsKit ``` -Note: The CocoaPods pod name is `ColorsKit`, but the Swift module remains `ColorKit`. - ## Usage ```swift -import ColorKit +import ColorsKit // Hex -> SwiftUI Color let primary = Color(hex: "#0A84FF") diff --git a/Example/ConsumerSample/Package.swift b/Example/ConsumerSample/Package.swift index 7c6eb96..be3bff2 100644 --- a/Example/ConsumerSample/Package.swift +++ b/Example/ConsumerSample/Package.swift @@ -16,7 +16,7 @@ let package = Package( .executableTarget( name: "ConsumerSample", dependencies: [ - .product(name: "ColorKit", package: "ColorKit") + .product(name: "ColorsKit", package: "ColorsKit") ] ) ] diff --git a/Example/ConsumerSample/Sources/ConsumerSample/ConsumerSample.swift b/Example/ConsumerSample/Sources/ConsumerSample/ConsumerSample.swift index cb36d76..243c839 100644 --- a/Example/ConsumerSample/Sources/ConsumerSample/ConsumerSample.swift +++ b/Example/ConsumerSample/Sources/ConsumerSample/ConsumerSample.swift @@ -1,5 +1,5 @@ import Foundation -import ColorKit +import ColorsKit @main struct ConsumerSample { diff --git a/Example/iOSAppDemo/README.md b/Example/iOSAppDemo/README.md index 5e52ced..6688110 100644 --- a/Example/iOSAppDemo/README.md +++ b/Example/iOSAppDemo/README.md @@ -1,22 +1,22 @@ # iOSAppDemo -A minimal SwiftUI demo app showcasing ColorKit usage. +A minimal SwiftUI demo app showcasing ColorsKit usage. ## Create the demo 1. Open Xcode > File > New > Project > iOS App (SwiftUI). -2. Name: ColorKitDemo, Interface: SwiftUI, Language: Swift. +2. Name: ColorsKitDemo, Interface: SwiftUI, Language: Swift. 3. Add this package via File > Add Packages... and search your repo URL. 4. In `ContentView.swift`: ```swift import SwiftUI -import ColorKit +import ColorsKit struct ContentView: View { var body: some View { VStack(spacing: 24) { - Text("ColorKit Demo") + Text("ColorsKit Demo") .font(.title) .foregroundStyle(Color.dynamic(lightHex: "#1C1C1E", darkHex: "#FFFFFF")) diff --git a/Package.swift b/Package.swift index 54a5eda..b0ddd99 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( - name: "ColorKit", + name: "ColorsKit", platforms: [ .iOS(.v13), .macOS(.v12), @@ -13,8 +13,8 @@ let package = Package( ], products: [ .library( - name: "ColorKit", - targets: ["ColorKit"] + name: "ColorsKit", + targets: ["ColorsKit"] ), ], targets: [ @@ -43,14 +43,14 @@ let package = Package( ), // Umbrella target that re-exports all modules for a single import .target( - name: "ColorKit", + name: "ColorsKit", dependencies: ["ColorCore", "ColorUtilities", "ColorExtensions", "ColorPalettes"], - path: "Sources/ColorKit" + path: "Sources/ColorsKit" ), // Tests .testTarget( name: "UnitTests", - dependencies: ["ColorKit"], + dependencies: ["ColorsKit"], path: "Tests/UnitTests" ), diff --git a/README.md b/README.md index 335fe83..6267a8b 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # ColorsKit -[![version](https://img.shields.io/github/v/tag/ckdash-git/ColorKit?label=version)](https://github.com/ckdash-git/ColorKit/tags) [![lines of code](https://tokei.rs/b1/github/ckdash-git/ColorKit?category=code)](https://github.com/ckdash-git/ColorKit) [![license](https://img.shields.io/github/license/ckdash-git/ColorKit)](https://github.com/ckdash-git/ColorKit/blob/main/LICENSE) +[![version](https://img.shields.io/github/v/tag/ckdash-git/ColorsKit?label=version)](https://github.com/ckdash-git/ColorsKit/tags) [![lines of code](https://tokei.rs/b1/github/ckdash-git/ColorsKit?category=code)](https://github.com/ckdash-git/ColorsKit) [![license](https://img.shields.io/github/license/ckdash-git/ColorsKit)](https://github.com/ckdash-git/ColorsKit/blob/main/LICENSE) Pragmatic color utilities for SwiftUI and UIKit. -ColorKit helps you parse hex colors, check accessibility contrast, generate palettes, build gradients, and simulate color‑vision deficiencies — all with a tiny, focused API that feels at home in Swift. +ColorsKit helps you parse hex colors, check accessibility contrast, generate palettes, build gradients, and simulate color‑vision deficiencies — all with a tiny, focused API that feels at home in Swift. ## Installation (SPM) Add the package to Xcode or your `Package.swift` using the public repo and a tag. -- URL: `https://github.com/ckdash-git/ColorKit.git` +- URL: `https://github.com/ckdash-git/ColorsKit.git` - Minimum platforms: iOS 13+, macOS 12+, tvOS 13+, watchOS 6+ ```swift @@ -21,13 +21,13 @@ Add the package to Xcode or your `Package.swift` using the public repo and a tag .target( name: "App", dependencies: [ - .product(name: "ColorKit", package: "ColorKit") + .product(name: "ColorsKit", package: "ColorsKit") ] ) ] ``` -In Xcode: File → Add Packages… → paste the URL → add the `ColorKit` product. +In Xcode: File → Add Packages… → paste the URL → add the `ColorsKit` product. ## Installation (CocoaPods) Add to your Podfile (iOS example): @@ -44,64 +44,12 @@ end Then run `pod install` and import the module: ```swift -import ColorKit +import ColorsKit ``` -Note: The CocoaPods pod name is `ColorsKit`, but the Swift module is `ColorKit`. - -## Features -- Hex parsing to and from `RGBA` (`#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA`) -- WCAG contrast ratio and AA/AAA compliance checks -- Palette generation around a base color -- SwiftUI/UIColor helpers (dynamic light/dark, gradients) -- Color‑blindness simulation (protanopia, deuteranopia, tritanopia) - -## Installation (SPM) -Add the package to Xcode or your `Package.swift` using the public repo and a tag. - -- URL: `https://github.com/ckdash-git/ColorKit.git` -- Minimum platforms: iOS 13+, macOS 12+, tvOS 13+, watchOS 6+ - -```swift -// Package.swift -.dependencies: [ - .package(url: "https://github.com/ckdash-git/ColorsKit.git", from: "0.1.2") -] -.targets: [ - .target( - name: "App", - dependencies: [ - .product(name: "ColorKit", package: "ColorKit") - ] - ) -] -``` - -In Xcode: File → Add Packages… → paste the URL → add the `ColorKit` product. - -## Installation (CocoaPods) -Add to your Podfile (iOS example): - -```ruby -platform :ios, '13.0' -use_frameworks! - -target 'App' do - pod 'ColorsKit', '~> 0.1' -end -``` - -Then run `pod install` and import the module: - -```swift -import ColorKit -``` - -Note: The CocoaPods pod name is `ColorsKit`, but the Swift module is `ColorKit`. - ## Quick Start ```swift -import ColorKit +import ColorsKit // Hex → RGBA let fg = try HexColorFormatter.parse("#1A73E8") @@ -122,7 +70,7 @@ let protanopia = ColorBlindnessSimulator.simulate(.protanopia, rgba: fg) ### SwiftUI ```swift import SwiftUI -import ColorKit +import ColorsKit // Create Color from hex let primary = Color(hex: "#0A84FF") @@ -137,7 +85,7 @@ let gradient = SwiftUIGradientBuilder.linear(hexColors: ["#0A84FF", "#5E5CE6"]) ### UIKit ```swift import UIKit -import ColorKit +import ColorsKit let primary = UIColor(hex: "#0A84FF") let dynamic = UIColor.dynamic(lightHex: "#FFFFFF", darkHex: "#000000") diff --git a/Scripts/automate_package.sh b/Scripts/automate_package.sh index e7e616b..fbc31f5 100755 --- a/Scripts/automate_package.sh +++ b/Scripts/automate_package.sh @@ -4,12 +4,12 @@ set -euo pipefail PROJECT_ROOT="$(cd "$(dirname "$0")"/.. && pwd)" cd "$PROJECT_ROOT" -echo "[ColorKit Automation] Starting..." +echo "[ColorsKit Automation] Starting..." # Initialize package if missing (skip if already present) if [[ ! -f "Package.swift" ]]; then - echo "Initializing Swift package ColorKit" - swift package init --name ColorKit --type library + echo "Initializing Swift package ColorsKit" + swift package init --name ColorsKit --type library fi # Build & Test (SPM) @@ -22,21 +22,21 @@ swift test # Generate docs with jazzy if installed if command -v jazzy >/dev/null 2>&1; then echo "Generating docs with jazzy" - jazzy --module ColorKit --output "$PROJECT_ROOT/docs" || true + jazzy --module ColorsKit --output "$PROJECT_ROOT/docs" || true else echo "[Skip] jazzy not found; install with 'gem install jazzy'" fi # CocoaPods setup: ensure podspec exists -if [[ ! -f "ColorKit.podspec" ]]; then - echo "Creating ColorKit.podspec" - cat > ColorKit.podspec <<'PODSPEC' +if [[ ! -f "ColorsKit.podspec" ]]; then + echo "Creating ColorsKit.podspec" + cat > ColorsKit.podspec <<'PODSPEC' Pod::Spec.new do |s| - s.name = 'ColorKit' + s.name = 'ColorsKit' s.version = '0.1.0' s.summary = 'Comprehensive color management for iOS: hex APIs, theming, accessibility, gradients.' - s.description = 'ColorKit simplifies color usage in iOS apps with hex parsing, dynamic colors, accessibility checks, palette generation, gradients, and simulators.' - s.homepage = 'https://example.com/ColorKit' + s.description = 'ColorsKit simplifies color usage in iOS apps with hex parsing, dynamic colors, accessibility checks, palette generation, gradients, and simulators.' + s.homepage = 'https://example.com/ColorsKit' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Your Name' => 'you@example.com' } s.source = { :git => 'https://github.com/your/repo.git', :tag => s.version.to_s } @@ -53,7 +53,7 @@ if command -v pod >/dev/null 2>&1; then echo "Validating podspec" pod lib lint --allow-warnings || true echo "[Info] To register trunk: pod trunk register you@example.com 'Your Name'" - echo "[Info] To push: pod trunk push ColorKit.podspec" + echo "[Info] To push: pod trunk push ColorsKit.podspec" else echo "[Skip] CocoaPods not found; install with 'sudo gem install cocoapods'" fi @@ -106,4 +106,4 @@ else echo "[Skip] Fastlane not found; install with 'gem install fastlane'" fi -echo "[ColorKit Automation] Done." \ No newline at end of file +echo "[ColorsKit Automation] Done." \ No newline at end of file diff --git a/Sources/ColorKit/ColorKit.swift b/Sources/ColorsKit/ColorsKit.swift similarity index 100% rename from Sources/ColorKit/ColorKit.swift rename to Sources/ColorsKit/ColorsKit.swift diff --git a/Tests/UnitTests/HexAndContrastTests.swift b/Tests/UnitTests/HexAndContrastTests.swift index 7796e2f..75481eb 100644 --- a/Tests/UnitTests/HexAndContrastTests.swift +++ b/Tests/UnitTests/HexAndContrastTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import ColorKit +@testable import ColorsKit final class HexAndContrastTests: XCTestCase { func testHexParsingShortRGB() throws {