on
Autumn Hues
I’m gonna give you some color see see.
Literally. :)
And here are some colors. Earlier this spring, I went to Rainbow Mountain, aka Zhangye Danxia Landform Geological Park in China, and was lucky enough to catch a real (and smiley) rainbow on top of the Rainbow Mountain, how cool is that?

I’ve been wanting to write a bit about the colors since then, but it’s been incredibly busy for me this year between work, workouts (hmm, did I mention I lost over 25 lbs this year?), and many other stuff. Before you know it, it’s not spring any longer - now we’re almost leaving autumn with winter lurking around the corner. 2025 is almost a goner!
Fast forward to today, which is Remembrance Day holiday in BC. After finishing up a 10K run at the lake park nearby this afternoon, I feel it’s high time that I rambled a bit on it. Dubbing it Autumn Hues before it’s too late!
Here’s another picture I took in BC recently, more fitting to the theme:

What is Color Anyways?
I’m gonna start by saying, colors ain’t real. It’s just a subjective perception of light.
OK, then, what is light?
Well, as we all know, light is just a subset of electromagnetic radiation that can be perceived by the human eyes - although broadly speaking, Ultraviolet(UV) and Infrared (IR) should be considered lights as well.
Here’s a demo of the perceivable (and invisible) color spectrum as per wavelengths.
Source: lenalighting.com
Sir Newton The Great strikes again, as he was credited for the initial discovery of this. Back a few centuries ago, in 1665, Newton used a prism to show that sunlight, i.e., clear white light, is refracted (bent) into its component colors, namely red, orange, yellow, green, blue, indigo, and violet (ROYGBIV). He also demonstrated that these seven visible colors can be recombined into a beam of white light.
It still remains for us to exhibit the system of the world from these same principles.
While he famously said these powerful words before explaining the mechanics of the solar systems via the universal laws of motion and gravitation. The laws of lights and colors should also be part of this system of the world.
Let’s see how that has been computerized 360 years later.
Digitalized Colors
Just when I thought I ran out full-stack developer jokes, here’s another one:
Credit: reddit
For the past ~8 years, I’ve been doing my fair share of jack of all trades at my engineering roles in Canada. While I mostly work on backend and infrastructure, occasionally I’d need to touch client-side or frontend or other ad hoc stuff. Whenever I’d have a UI/UX task, however, I felt compelled to clarify that I just am not very good at manipulating pixels. I kinda know what they are, but it’s aesthetically difficult for me to be good at it (not everyone is Steve Jobs I guess!). Also just like a certain well-known billionaire, I too am a big fan of pure / solid colors in daily life. So it’s fair to say picking colors ain’t really my forte!
Okay. Enough with the disclaimers. Let’s dive into it.
For most computer color models, we just use RGB (red, green, and blue), with a 8-bit representation for each color. For example, full red would be (255, 0, 0) if we use R, G, B as the underlying 3D dimensional space. Or oftentimes, it’s being referenced as its equivalent hexadecimal form: #FF0000 (you can also visualize this in a hex color visualizer)
RGBs are considered the primary colors of light, because if you mix them, you can get other colors. But they cannot be derived from mixing other colors.
Let’s visualize some palettes using Python. We’ll start by aiming for Red, i.e. #FF0000, by incrementing only the red coordinates by 16 from left to right.
# Since it's 0-based, we deduct steps of 16 from 255. This creates:
# [15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255]
hex_values = list(range(255, 0, -16))[::-1]
print(f"Hex values: {[hex(h) for h in hex_values]}")
# Create RED palette: varying red to 0xFF, green=0, blue=0
# Each color is normalized to 0-1 range for our beloved matplotlib
red_palette = [(i / 255.0, 0.0, 0.0) for i in hex_values]
With a bit help from the mighty matplotlib, we can see a red palette as we gradually crank up the dosage, from left to the far right of the spectrum.

Same steps for Green:

Ditto for Blue:

Now let’s see what happens if we start mixing any two.
Red + Green => Yellow, as we gradually add more reds and greens:

Green + Blue => Cyan:

Red + Blue => Magenta:

And if we mix all three, i.e. Red + Green + Blue, we should get white if we add more:

Yup, it’s just simple and intuitive as that. Sir Newton was absolutely right!
Additive Mixing vs Subtractive Mixing
Additive Mixing
In the aforementioned RGB pallette creation processes, we can start with #000000 - since no color was added, it’d be pitch black to begin with. But as we light up (let there be light!) gradually, after adding all colors, we’d get a #FFFFFF at the end, which is fully white. This’d be what we call an Additive Mixing model, which works for light sources, such as monitors, that emit lights.
For the RGB 3D space, represented by the 8-bit hex system, we’d have a total permutation of:
256 x 256 x 256 = 16,777,216
i.e. total 16+ million possible colors in the complete color palette, which is more than enough colors that bare human eyes can perceive. Some higher-end fancier monitors may offer 10-bit systems that can offer much more colors.
Subtractive Mixing
However, for objects that don’t emit lights, the colors are created by subtracting or absorbing certain wavelengths of light from white light. That is, if an object is seen as blue, that’s because it absorbed all other wavelengths of light but blue’s, so only blue light is being reflected and seen.
For example, this mechanism can be found in coloring via pigments and inks. If we start mixing different colored pigments, different wavelengths of light will get absorbed and reflected \/, and thus different colors would be seen. We call this color mixing strategy Subtractive Mixing, as the more colors you add, the darker it gets. Picture yourself in front of a piece of white paper, and if you start gradually adding all the pigments, you’d see it turn black at the end. So in a way, subtractive color mixing is just the opposite of additive color mixing.
This is being widely used by artists, publishers, and other paper media etc. But instead of RGB, RYB (Red, Yellow, Blue) or other variations are used as primary colors.
I am unsure how to digitize this subtractive color mixing process (yet). It’s clearly not gonna be as simple as just flipping the 8-bit representation. Mark it down as TODO here. :)
Trichromacy vs Tetrachromacy
Coincidentally (or is it?), as a biology setup, human eyes have the ability to see colors using three types of cone cells in the eye, which perceive red, green and blue respectively. This is called Trichromacy.
But not every being is created equal, birds, for example, would have an extra fourth type of cone cell for perceiving colors, which makes them possess the precious Tetrachromacy. Here’s a comparison:
Credit: demilked.com
And the colors each sees:

Wouldn’t it be cool if we also have tetrachromacy? It’d be an artist’s dream come true! I think our ancestors may also have this gene eons ago but at one point, it got lost as we started living indoors and this became less essential (for birds, this tetrachromacy capability would enable them to spot flowers and seeds more easily, among other benefits). What a shame though.
Epilog
I wanted to experiment more, but I’ll be honest, Cursor had rate-limited me for the day :(. And I’m just too lazy and tired to continue writing and debugging any more Python code in the absence of its help.
That’s the thing. This is a new era now. And this era was divided by prior- and post- Nov 30, 2022, the day when ChatGPT was released - to put it into perspective, that was just less than 3 years from today. I’ve been blogging since before that time, and was fortunate enough to work on AI before it became so cool that everyone’s talking about it. But I’ve been trying to make a point that I don’t use any AI to write the blogs for me, due to some weird old-fashioned craftsmanship pride. And up till this post, I am pride to say that I still don’t (but I’ll admit, it’s probably a much better writer than me..).
Although starting last year, I think I’ve lost the fort on the programming front. I’ve become a cautiously optimistic vibe coder. For small things, I’d use AI to help with some short snippets by designing the prompts and plans, writing down a bit scaffold code, laying down the structure, proof-reading, and fixing by hand if I need to. It’s surprisingly good, especially at writing tests (I meant, who needs tests anyways. :D).
I was chatting with our product manager earlier this week, and we resonated that in this AI time and age, it’s becoming harder to do any structured learning at all due to the fact that AI assistants have become so powerful and ubiquitous. And the ROIs on upskilling specific areas are diminishing rapidly - who cares about the latest features of Java releases, or the nitty gritty of some archaic syntax any more? Just ask Claude or Cursor with a prompt, get a cup of coffee and come back. You’ll have your answers before you know it!
Also as an interesting trend, different tech roles seem to be quickly converging. Engineers are now expected to have more product sense; PMs are expected to be able to do prototypes with help from AI assistants like Cursor. But I joked that given PMs own one thing that AI can’t yet, which is prioritization by aligning with humans, it’s likely that product management as a profession will outlast us software engineers.
So it begins. Any hand-made stuff that’s not produced by AI, now including manually typing all the code for programs from scratch, would essentially become luxuries1 in future.
Alright, with that, I’ll end my ramblings today with my own RYB palette on my home office desk - since they’re not light sources, I’m sticking to the RYB model (also a green duck would be somewhat strange!).

-
I think by its very definition, a luxury is something that you don’t necessarily need or can’t easily afford to have. You can easily find cheaper alternatives if functionality is what you’re aiming for. A Honda Civic is probably just as good as a Ferrari, when it comes what a car was designed to do, which is getting from A to B. But for some reasons, people are still willing to buy Ferraris (I totally would, if I could lol).
As another example, I have an Apple watch and an Eco-Drive, but I also own a mechanical watch. If anything, Apple watch tells time more accurately, and there’s no need to adjust for day light savings twice a year (it also tracks health stats! I’ve been closing my rings if you know what that means). But I still wear my mechanical watch every now and then (kinda have to alas.. part of the maintenance process to keep the springs in good standing); it sure is heavier too but I’ll be darned if it ain’t a pretty thing and a great source of joy by just looking at it (yea yea it tells time too!). I guess that’s why people dub it Emotional Value. I’m guilty as charged for being a captive of this consumerism rhetorics. ↩