ReadViewSDK/Sources/RDReaderView/LegacyRDReaderController/RDReaderTheme.swift
2026-05-21 19:40:51 +08:00

76 lines
3.2 KiB
Swift

//
// RDReaderTheme.swift
// RDReaderDemo
//
// Created by yangsq on 2021/8/10.
//
import Foundation
import UIKit
public protocol RDReaderTheme {
var contentBackgroudColor: UIColor? { get }
var contentTextColor: UIColor? { get }
var toolBackgroudColor: UIColor? { get }
var toolControlTextColor: UIColor? { get }
var toolControlBorderUnSelectColor: UIColor? { get }
var toolLineColor: UIColor? { get }
}
struct WhiteTheme: RDReaderTheme {
var contentBackgroudColor: UIColor? = UIColor.white
var contentTextColor: UIColor? = UIColor.black
var toolBackgroudColor: UIColor? = UIColor.white
var toolControlTextColor: UIColor? = UIColor.black
var toolControlBorderUnSelectColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
var toolLineColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
}
struct DarkTheme: RDReaderTheme {
var contentBackgroudColor: UIColor? = UIColor.black
var contentTextColor: UIColor? = UIColor.white
var toolBackgroudColor: UIColor? = UIColor.black
var toolControlTextColor: UIColor? = UIColor.white
var toolControlBorderUnSelectColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
var toolLineColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
}
struct YellowTheme: RDReaderTheme {
var contentBackgroudColor: UIColor? = UIColor(red: 0.89, green: 0.87, blue: 0.79, alpha: 1)
var contentTextColor: UIColor? = UIColor.black
var toolBackgroudColor: UIColor? = UIColor(red: 0.89, green: 0.87, blue: 0.79, alpha: 1)
var toolControlTextColor: UIColor? = UIColor.black
var toolControlBorderUnSelectColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
var toolLineColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
}
struct GreenTheme: RDReaderTheme {
var contentBackgroudColor: UIColor? = UIColor(red: 0.87, green: 0.91, blue: 0.82, alpha: 1)
var contentTextColor: UIColor? = UIColor.black
var toolBackgroudColor: UIColor? = UIColor(red: 0.87, green: 0.91, blue: 0.82, alpha: 1)
var toolControlTextColor: UIColor? = UIColor.black
var toolControlBorderUnSelectColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
var toolLineColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
}
struct PinkTheme: RDReaderTheme {
var contentBackgroudColor: UIColor? = UIColor(red: 1, green: 0.89, blue: 0.91, alpha: 1)
var contentTextColor: UIColor? = UIColor.black
var toolBackgroudColor: UIColor? = UIColor(red: 1, green: 0.89, blue: 0.91, alpha: 1)
var toolControlTextColor: UIColor? = UIColor.black
var toolControlBorderUnSelectColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
var toolLineColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
}
struct BlueTheme: RDReaderTheme {
var contentBackgroudColor: UIColor? = UIColor(red: 0.8, green: 0.84, blue: 0.89, alpha: 1)
var contentTextColor: UIColor? = UIColor.black
var toolBackgroudColor: UIColor? = UIColor(red: 0.8, green: 0.84, blue: 0.89, alpha: 1)
var toolControlTextColor: UIColor? = UIColor.black
var toolControlBorderUnSelectColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
var toolLineColor: UIColor? = UIColor.lightGray.withAlphaComponent(0.5)
}