auramagi / newicon Goto Github PK
View Code? Open in Web Editor NEWmacOS icon customization
License: MIT License
macOS icon customization
License: MIT License
These are current view capture steps:
cacheDisplay(in:to:)
However, using cacheDisplay
produces some side-effects and the resulting image does not exactly match View as displayed.
To get around some display issues, we tell SwiftUI to first flatten view hierarchy by itself using the drawingGroup modifier.
But even this has some weirdness, especially with blend modes. First of all, it loses all transparency, but that part is at least consistent with previews/actual rendering after using drawingGroup
.
Using .overlay(Color.mint.blendMode(.hue))
:
We can get around that by masking the result with the initial view:
NewIcon/SampleTemplates/NewHue.swift
Line 53 in f441f60
But this still leaves us with incorrectly blended color in some parts.
Compare to how this looks in previews and when displayed in a window.
Unreadable when dark mode is disabled.
as is:
text is difficult to read
to be:
text can be read
environment:
Dark mode OFF
Mac OS 12.3.1(21E258)
❯ mint run auramagi/NewIcon -h
🌱 Finding latest version of NewIcon
🌱 Running new-icon 0.1.1...
OVERVIEW: macOS icon customization
❯ mint version
Version: 0.17.1
❯ swift --version
swift-driver version: 1.45.2 Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
Target: arm64-apple-macosx12.0
to reproduce:
❯ mint run auramagi/NewIcon text /Applications/Xcode-13.3.1.app 13.3.1
🌱 Finding latest version of NewIcon
🌱 Running new-icon 0.1.1...
workaround:
Dark mode ON
Rerun!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.