This code can easily be refactored to use adafruit_pixelbuf - refactoring based on adafruit_dotstar will help guide the work.