What is the correct way to update RGB values of a colorLiteral in Xcodet?

Swift provides color literals which can be written as follows:

#colorLiteral(red: 1, green: 0.8431372549, blue: 0.8235294118, alpha: 1)

After this line of code is written, Xcode transforms it into a color image in the code as shown below.

enter image description here

Once it is has been automagically transformed into this image, how can I edit the specific RGB values? (I realize I can use the color picker to pick my own color, but I would like to use specific RGB values, not try to pick a color in the UI.).

So the question is, how do you update the color to specific RGB values without deleting and re-writing the color literal?



Read more here: https://stackoverflow.com/questions/66271728/what-is-the-correct-way-to-update-rgb-values-of-a-colorliteral-in-xcodet

Content Attribution

This content was originally published by Andrew Paul Simmons at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: