RGB LED blinks when analogWrite is low
The maximum value you can pass to analogWrite() is 255. Anything higher than that will wrap around back to 0.

You should scale your value to fit into 0-255 instead of 0-1024.