var CodeBackground = #colorLiteral(red: 0.1294117647, green: 0.1294117647, blue: 0.1960784314, alpha: 1)
cells?.layer.borderColor = //... how can i set this color literal to cgColor?
As I know how to convert that UIColor to cgColor in the Swift
as example
UIColor.black.cgColor
Bingo, but what about Color Literal to cgColor in the Swift
Thank you.
colorLiteralascgcolor, I'll jump to the other way of doing that...For that you need a Custom Function which gets the color-value(red , green , blue) from the
colorLiteral, which is as belowNow , after this function created you can convert
colorliteralintocgColoras below...You can directly use
Converted_cgColorlikeHOPE IT HELPS