easily get hex rgb for Color Literals in xcode?

anyone know a quick way to get the hex codes for color literals in xcode?

if you open the file with a regular text editor you can see [0,1] rgb values,

and then of course get out the calculator or use the "digital color meter" app

but... seems kind of backwards.

Replies

You could write a little playground to get that

As simple as


let aColor : UIColor =  color //     colorLiteral(red: 0.2745098174, green: 0.4862745106, blue: 0.1411764771, alpha: 1)


Then double click the color to select in a panel


print(aColor)

gives the RGB values


Should be interested in reading this

h ttps://medium.com/@gurdeep060289/color-image-new-literals-in-the-cocoa-town-7ef4f2710194