The key is in the pixel format - in the case of Bubble 8, the default is set to 9 bits per pixel, formatted as shown:
You can see to represent one pixel, it takes 9 bits.
The first 3 bits represents how much red. If you want full red, the first 3 bits should be 111. If you wanted no red (think of it as turning the red lights off), the first 3 bits should be 000.
Let’s say you wanted this pixel to be red. You’d set the first 3 bits to 111 to set the red channel to max, but then you’d want to turn the green and blue channels off, so you’d set the middle 3 bits (the green channel) to 000 and the last 3 bits (the blue channel) to 000.
To set a pixel to be white, you want to set all 3 channels to max, so max red, max green, max blue - 111111111.
Now what about pink? It’s somewhere between the red pixel and the white pixel.
So you want full red. 111------
And let’s do something between what we did for the red pixel and white pixel - let’s set the green to half and blue to half. 111 is full, 7 in decimal. 000 is empty, 0 in decimal. Halfway-ish can be 3 in decimal, which is binary 011. Let’s use that for the green and blue, giving us a red of 111, green of 011, blue of 011…
Try it and see how it looks.
To play around with the concept of adjusting red, green, and blue channels to create shades of colors, try these pixel widgets:
https://studio.code.org/projects/applab/qiyLvNCBDuOYbaBB8oe0isTwNDYTOeGA5cpWlhHNTzM (by Alan Schmitt)
(ignore the references to 12-bit hex code since you’re using a 9-bit binary code, but the concept of adjusting color channels still applies)