Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Colors): Update Color Palette definition. #206

Merged
merged 18 commits into from
Aug 11, 2022

Conversation

jmpg93
Copy link
Contributor

@jmpg93 jmpg93 commented Aug 10, 2022

Hi there!

This PR is about updating the catalog to match what design had in mind: https://www.figma.com/file/OVN2YGEZZ0Gj7TXVoMblli/M%C3%ADstica-Catalog?node-id=1%3A6237

The new catalog uses different colors and have a new Colors tab.

demo.mp4

@@ -19,7 +19,6 @@ enum CatalogRow: Int, CaseIterable, Identifiable {
case chips
case carousel
case feedbacks
case fonts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now a tab

Comment on lines 51 to 69
var colors: [(name: String, paletteName: String?, color: UIColor)] {
let misticaColorsByName = ColorInspector(value: MisticaConfig.currentColors).colorsByName
let paletteColorsByName = ColorInspector(value: paletteColors).colorsByName

return misticaColorsByName
.map { name, color in
let paletteName = paletteColorsByName.first { $0.value.hexString == color.hexString }?.key
return (name: name, paletteName: paletteName, color: color)
}
.sorted { lItem, rItem in lItem.name < rItem.name }
.filter { element in
guard !searchText.isEmpty else { return true }
let name = element.name.lowercased()
let paletteName = (element.paletteName ?? "").lowercased()
let hex = element.color.hexString.lowercased()
let searchText = searchText.lowercased()
return name.contains(searchText) || paletteName.contains(searchText) || hex.contains(searchText)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring magic to retrieve the colors.

}

public enum BlauColorPalette {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we going to make a breaking change. I've updated the color definition.
No color changes, just moved the static properties to properties.

@jmpg93 jmpg93 self-assigned this Aug 10, 2022
@jmpg93 jmpg93 marked this pull request as ready for review August 10, 2022 14:19
Base automatically changed from feature/mistica-swiftui to main August 10, 2022 15:22
jmpg93 and others added 2 commits August 10, 2022 18:00
# Conflicts:
#	Mistica/Source/Fonts/FontToolkit.swift
#	MisticaCatalog/MisticaCatalog.xcodeproj/project.pbxproj
#	MisticaCatalog/Source/Catalog/CatalogList.swift
#	MisticaCatalog/Source/Catalog/CatalogRow.swift
#	MisticaCatalog/Source/Catalog/Framework.swift
#	MisticaCatalog/Source/ContentView.swift
#	MisticaCatalog/Source/MisticaCatalogApp.swift
#	Sources/MisticaCommon/Colors/BlauColorPalette.swift
#	Sources/MisticaCommon/Colors/MovistarColorPalette.swift
#	Sources/MisticaCommon/Colors/O2ClassicColorPalette.swift
#	Sources/MisticaCommon/Colors/O2ColorPalette.swift
#	Sources/MisticaCommon/Colors/VivoColorPalette.swift
#	Sources/MisticaCommon/Fonts/FontToolkit+Font.swift
#	Sources/MisticaCommon/Fonts/FontToolkit+UIFont.swift
#	Sources/MisticaCommon/MisticaConfig.swift
#	Sources/MisticaCommon/Styles/BrandStyle.swift
#	Sources/MisticaSwiftUI/Components/Tabs/Tabs.swift
@jmbrocal
Copy link
Contributor

The new catalog is pretty cool!!!

But I see something weird in the color pallete. When the color is the same color as the background you cannot see the color XD.. Can we do something to improve this colors? Changing the background or adding a border to the circle?

WTDY?

jmbrocal
jmbrocal previously approved these changes Aug 11, 2022
@jmpg93
Copy link
Contributor Author

jmpg93 commented Aug 11, 2022

The new catalog is pretty cool!!!

But I see something weird in the color pallete. When the color is the same color as the background you cannot see the color XD.. Can we do something to improve this colors? Changing the background or adding a border to the circle?

WTDY?

Right, I will try to improve it.

@jmpg93
Copy link
Contributor Author

jmpg93 commented Aug 11, 2022

The new catalog is pretty cool!!!

But I see something weird in the color pallete. When the color is the same color as the background you cannot see the color XD.. Can we do something to improve this colors? Changing the background or adding a border to the circle?

WTDY?

Done!

image

@jmpg93 jmpg93 requested a review from jmbrocal August 11, 2022 10:12
# Conflicts:
#	MisticaCatalog/MisticaCatalog.xcodeproj/project.pbxproj
Copy link
Contributor

@salavert salavert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice

@jmpg93 jmpg93 changed the title Update catalog refactor(Colors): Update Color Palette definition. Aug 11, 2022
@jmpg93 jmpg93 merged commit f433140 into main Aug 11, 2022
@jmpg93 jmpg93 deleted the feature/mistica-swiftui-catalog branch August 11, 2022 12:46
tuentisre pushed a commit that referenced this pull request Aug 11, 2022
# [18.0.0](v17.1.0...v18.0.0) (2022-08-11)

### Code Refactoring

* **Colors:** Update Color Palette definition. ([#206](#206)) ([f433140](f433140))

### Features

* **SwiftUI:** Support Mistica in SwiftUI ([#200](#200)) ([b2689ef](b2689ef))

### BREAKING CHANGES

* **Colors:** Color palette properties are no longer static variabales.
* **SwiftUI:** Custom brands are now supported.
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 18.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants