Skip to content

Commit 4b809dc

Browse files
committed
Update README with HSL color support and performance optimization
- Add HSL color section with usage examples and parameter format - Remove specific performance improvement percentages - Simplify performance optimization section for better readability - Maintain consistent documentation style with other color methods
1 parent 0688b32 commit 4b809dc

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ You could know more information on how to use Swift Package Manager in Apple's [
6767

6868
## Performance Optimization
6969

70-
Rainbow v4.2.0+ includes significant performance optimizations for high-frequency styling operations.
70+
Rainbow v4.2.0+ includes performance optimizations for high-frequency styling operations.
7171

72-
### Builder Pattern (578% faster for complex chaining)
72+
### Builder Pattern
7373

7474
For complex styling with multiple chained calls, use the builder pattern:
7575

@@ -81,7 +81,7 @@ let traditional = "Hello".red.bold.underline.onBlue
8181
let optimized = "Hello".styled.red.bold.underline.onBlue.build()
8282
```
8383

84-
### Batch Operations (264% faster for multiple styles)
84+
### Batch Operations
8585

8686
Apply multiple styles in a single operation:
8787

@@ -152,6 +152,17 @@ print("\("春色满园".hex("#ea517f", to: .bit24))关不住,\("一枝红杏".
152152

153153
![](https://user-images.githubusercontent.com/1019875/110496210-9d2c2600-8138-11eb-803d-15a745ef1dfb.png)
154154

155+
### HSL Colors
156+
157+
HSL (Hue, Saturation, Lightness) colors are also supported:
158+
159+
```swift
160+
print("天街小雨润如酥,草色遥看近却无".hsl(120, 20, 80))
161+
print("最是一年春好处,绝胜烟柳满皇都".hsl(90, 60, 70))
162+
```
163+
164+
> Format: `hue` (0-360°), `saturation` (0-100%), `lightness` (0-100%)
165+
155166
### Output Target
156167

157168
By default, Rainbow should be smart enough to detect the output target, to determine if it is a tty. For example, it

0 commit comments

Comments
 (0)