Skip to content

Commit

Permalink
Update color documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlokhorst committed Dec 17, 2017
1 parent 43596e0 commit 85ae35a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
26 changes: 0 additions & 26 deletions Documentation/Colors.md

This file was deleted.

9 changes: 2 additions & 7 deletions Documentation/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,14 @@ let jsonPath = R.file.seedDataJson.path()

*Vanilla*
```swift
label.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 0.5)
label.textColor = UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0)
view.backgroundColor = UIColor(named: "primary background")
```

*With R.swift*
```swift
// Colors are extracted from the *.clr files that are in your Xcode project
label.backgroundColor = R.clr.appColors.backgroundColor()
label.textColor = R.clr.appColors.textColor()
view.backgroundColor = R.color.primaryBackground()
```

There are some points to keep in mind when using Color palettes, see [About Colors](Colors.md)

## Localized strings

*Vanilla*
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Currently you type:
```swift
let icon = UIImage(named: "settings-icon")
let font = UIFont(name: "San Francisco", size: 42)
let color = UIColor(named: "indictator highlight")
let viewController = CustomViewController(nibName: "CustomView", bundle: nil)
let string = String(format: NSLocalizedString("welcome.withName", comment: ""), locale: NSLocale.current, "Arthur Dent")
```
Expand All @@ -21,6 +22,7 @@ With R.swift it becomes:
```swift
let icon = R.image.settingsIcon()
let font = R.font.sanFrancisco(size: 42)
let color = R.color.indicatorHighlight()
let viewController = CustomViewController(nib: R.nib.customView)
let string = R.string.localizable.welcomeWithName("Arthur Dent")
```
Expand Down

0 comments on commit 85ae35a

Please sign in to comment.