Skip to content

Commit

Permalink
Use new feedback suggestion color for the vertical lines indicating s…
Browse files Browse the repository at this point in the history
…uggestion
  • Loading branch information
terlan98 committed Dec 2, 2023
1 parent f79ace5 commit d7ea693
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CodeEditor/Sources/CodeEditor/Extensions/UIColorExtension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// UIColorExtension.swift
//
//
// Created by Tarlan Ismayilsoy on 02.12.23.
//

import UIKit

extension UIColor {
static let feedbackSuggestionColor = UIColor(netHex: 0xB54EFE)
}
2 changes: 1 addition & 1 deletion CodeEditor/Sources/CodeEditor/LighbulbButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class LightbulbButton: UIButton {
}

private func setup() {
self.backgroundColor = UIColor(netHex: 0xB54EFE)
self.backgroundColor = .feedbackSuggestionColor
self.layer.cornerRadius = 6

let image = UIImage(named: "SuggestedFeedbackSymbol")?.withRenderingMode(.alwaysTemplate)

Check warning on line 32 in CodeEditor/Sources/CodeEditor/LighbulbButton.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Object Literal Violation: Prefer object literals over image and color inits. (object_literal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ class RoundedCornerLayoutManager: NSLayoutManager {
return
}
UIGraphicsPushContext(ctx)
ctx.setFillColor(CGColor(red: 0, green: 0.2, blue: 0.8, alpha: 0.8))
ctx.setStrokeColor(CGColor(red: 0, green: 0.2, blue: 0.8, alpha: 0.8))
ctx.setFillColor(UIColor.feedbackSuggestionColor.cgColor)

let programmingSuggestions = feedbackSuggestions.compactMap({ $0 as? ProgrammingFeedbackSuggestion })
if programmingSuggestions.contains(where: { paraNumber + 1 >= $0.lineStart ?? 0 && paraNumber + 1 <= $0.lineEnd ?? 0 }) {
Expand Down

0 comments on commit d7ea693

Please sign in to comment.