Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to ColorKit
# Contributing to ColorsKit

Thanks for considering a contribution! This project welcomes issues and pull requests.

Expand Down
10 changes: 5 additions & 5 deletions ColorsKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ 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
- Accessibility contrast checking
- 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
6 changes: 3 additions & 3 deletions Documentation/APIReference.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
18 changes: 8 additions & 10 deletions Documentation/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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`:
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion Example/ConsumerSample/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
.executableTarget(
name: "ConsumerSample",
dependencies: [
.product(name: "ColorKit", package: "ColorKit")
.product(name: "ColorsKit", package: "ColorsKit")
]
)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
import ColorKit
import ColorsKit

@main
struct ConsumerSample {
Expand Down
8 changes: 4 additions & 4 deletions Example/iOSAppDemo/README.md
Original file line number Diff line number Diff line change
@@ -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"))

Expand Down
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import PackageDescription

let package = Package(
name: "ColorKit",
name: "ColorsKit",
platforms: [
.iOS(.v13),
.macOS(.v12),
Expand All @@ -13,8 +13,8 @@ let package = Package(
],
products: [
.library(
name: "ColorKit",
targets: ["ColorKit"]
name: "ColorsKit",
targets: ["ColorsKit"]
),
],
targets: [
Expand Down Expand Up @@ -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"
),

Expand Down
70 changes: 9 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand Down
24 changes: 12 additions & 12 deletions Scripts/automate_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 }
Expand All @@ -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
Expand Down Expand Up @@ -106,4 +106,4 @@ else
echo "[Skip] Fastlane not found; install with 'gem install fastlane'"
fi

echo "[ColorKit Automation] Done."
echo "[ColorsKit Automation] Done."
File renamed without changes.
2 changes: 1 addition & 1 deletion Tests/UnitTests/HexAndContrastTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
@testable import ColorKit
@testable import ColorsKit

final class HexAndContrastTests: XCTestCase {
func testHexParsingShortRGB() throws {
Expand Down