-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
@@ -19,7 +19,6 @@ enum CatalogRow: Int, CaseIterable, Identifiable { | |||
case chips | |||
case carousel | |||
case feedbacks | |||
case fonts |
There was a problem hiding this comment.
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
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) | ||
} | ||
} |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
# 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
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. |
# Conflicts: # MisticaCatalog/MisticaCatalog.xcodeproj/project.pbxproj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice
# [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.
🎉 This PR is included in version 18.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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