|
I wasn't completely happy with Swift's built-in color palette. For instance, Luckily there is already a color palette to my liking that I've been using when developing websites: the Bootstrap color palette. So I created Xcode color sets for all Bootstrap colors. Adding them to a Swift project is as easy as dragging the color sets into the Assets list in Xcode. And using them is equally simple, e.g. You can find the GitHub project and the source files here: https://github.com/leomakkinje/Bootstrap-Color-Sets-for-Xcode |
|
As someone with a background in creative, thank you! I usually work with HEX codes and that seems to help. |
|
Nice. A few sugestations
|
|
Hello @NigelGee,
I did try that but I wasn't happy with the user experience. When dragging an asset catalog into a project, a window pops up where the user has to select for which targets the asset catalog should be enabled. I think this popup could be confusing for some folks, therefore I decided to not create a separate asset catalog. I prefer the current implementation because it's literally drag&drop without any potentially confusing popup windows.
I also tried that, and didn't like that implementation either because the asset catalog will then reside in a separate Bundle which has to be addressed specifically in code by referring to
I'm not sure I understand what you're referring to: the .bsPrimary color (which is basically .bsBlue) or another color? Regarding White in Light mode and Black in Dark Mode: that is exactly what .bsBodyBackground and .bsBodyForeground do.
Another thing I indeed tried. But as it turns out there is a reason why the authors of Bootstrap have not implemented this (and therefore I also didn't implement it). The thing is that the contrast between the Light Mode background color (white) and any xxx100 foreground color is not the same as the Dark Mode background color (.bsGray900) and the xxx900 foreground color (which would be the opposite of the xxx100 color). More specific: .bsBodyBackground and a Text element in .bsBlue100 looks fine in Light Mode. In Dark Mode the Text element would have foreground color .bsBlue900 and the background would be .bsGray900. I tried that but it's almost impossible to read the contents of the Text element. So maybe mathematical it makes sense to have xxx100 and xxx900 as counterparts (that's exactly what I thought at first) but seeing it on-screen made me realize it doesn't have the same visual effect. |
|
Thank you for taking time to reply with your thoughts.
When any file is drag into a project it all ways give this pop up so do not think any user would find it confusing. It just that
I thought maybe you can access the
I saw that you
I understand the reason that you gave but if a choose Maybe a set of colors that do this eg |
|
That is a great idea. I like it!
As mentioned in my first post I'm not looking forward to creating custom color palettes. But please feel free to clone the repository, add the Adaptive versions and then do a pull request. Looking forward to it! :-) |
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.