Skip to content

Instantly share code, notes, and snippets.

View andrejilderda's full-sized avatar
👋

Andre Jilderda andrejilderda

👋
View GitHub Profile
function onVisibilityChange(callback) {
let visible = true;
const focused = () => {
if (!visible) callback((visible = true));
}
const unfocused = () => {
if (visible) callback((visible = false));
}
@andrejilderda
andrejilderda / system-colors.swift
Last active March 26, 2024 11:44 — forked from jcarpenter/swift
Output system colors from macOS
import Cocoa
print("\n/* -------------- System Colors -------------- */")
// See: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color/#system-colors
print("systemBlue:", NSColor.systemBlue.rgbaCssString)
print("systemBrown:", NSColor.systemBrown.rgbaCssString)
print("systemGray:", NSColor.systemGray.rgbaCssString)
print("systemGreen:", NSColor.systemGreen.rgbaCssString)
print("systemIndigo:", NSColor.systemIndigo.rgbaCssString)