I know how to convert int value into data
let value: NSInteger = 1
let valueData:Data = Data(buffer: UnsafeBufferPointer(start: &intVal, count: 1))
Now I want to do the same with RGB color denoted in the following way 0xRRGGBB
How can I achieve it? Should I write it as String, e.q. "543621", then convert it into byte array then convert it to Data?
let valueData = Data([1])