I am trying to create a fluent color transition through all rgb color combinations and their complement, my attempt so far is:
var count = x // this is the index of the current color var red = CGFloat((count >> 16) & 0xFF)/255.0; var green = CGFloat((count >> 8) & 0xFF)/255.0; var blue = CGFloat((count) & 0xFF)/255.0; var color = UIColor(red: red, green: green, blue: blue, alpha: 1.0) var complement = UIColor(red: 1.0-red, green: 1.0-green, blue: 1.0-blue, alpha: 1.0)
the problem with this approach is that after every 255 colors there is a cut break to a 'nearly' all black screen as the next red index gets incremented an all other start at 0.
my wish is to go through all colors without having any 'jumps'. is this even possible? (the order of colors is not really important - ie does not matter if we start at red or blue or green, black or white.)