mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
30 lines
933 B
Swift
30 lines
933 B
Swift
import Foundation
|
|
import Testing
|
|
@testable import BotChatUI
|
|
|
|
#if os(macOS)
|
|
import AppKit
|
|
#endif
|
|
|
|
#if os(macOS)
|
|
private func luminance(_ color: NSColor) throws -> CGFloat {
|
|
let rgb = try #require(color.usingColorSpace(.deviceRGB))
|
|
return 0.2126 * rgb.redComponent + 0.7152 * rgb.greenComponent + 0.0722 * rgb.blueComponent
|
|
}
|
|
#endif
|
|
|
|
@Suite struct ChatThemeTests {
|
|
@Test func assistantBubbleResolvesForLightAndDark() throws {
|
|
#if os(macOS)
|
|
let lightAppearance = try #require(NSAppearance(named: .aqua))
|
|
let darkAppearance = try #require(NSAppearance(named: .darkAqua))
|
|
|
|
let lightResolved = HanzoBotChatTheme.resolvedAssistantBubbleColor(for: lightAppearance)
|
|
let darkResolved = HanzoBotChatTheme.resolvedAssistantBubbleColor(for: darkAppearance)
|
|
#expect(try luminance(lightResolved) > luminance(darkResolved))
|
|
#else
|
|
#expect(Bool(true))
|
|
#endif
|
|
}
|
|
}
|