Skip to content

Commit

Permalink
fix dynamic color crash (#143)
Browse files Browse the repository at this point in the history
Reproduce: in color picker click Color Palettes and select Developer.
  • Loading branch information
ksqsf authored Jun 4, 2024
1 parent 6816bd2 commit 6324022
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config/optionmodels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ private func stringToColor(_ hex: String) -> Color {
}

private func colorToString(_ color: Color) -> String {
let components = color.cgColor!.components!
let resolved = NSColor(color)
let components = resolved.cgColor.components!
let red = UInt8(round(components[0] * 255.0))
let green = UInt8(round(components[1] * 255.0))
let blue = UInt8(round(components[2] * 255.0))
Expand Down

0 comments on commit 6324022

Please sign in to comment.