Why the combination of yellow and blue is gray in TikZ?

TeX - LaTeX Asked on May 9, 2021

In page 1003/1318 TikZ manual there is an example to generate the array of colorful balls as below:

enter image description here

The ball color in (x=3, y=2) is made by combining 50% yellow and 50% blue according to the 2 variable for loop. But instead of green it is gray. Do you know why?
Below is my code:


foreach x / cola in {0/red,1/green,2/blue,3/yellow}
foreach y / colb in {0/red,1/green,2/blue,3/yellow}
shade[ball color=cola!50!colb] (x,y) circle (0.4cm);

One Answer

Based on @Ulrike Fischer and @ Symbol 1 comments:yellow is [1 1 0] in rgb, and blue is [0 0 1] so cola!50!colb is [0.5 0.5 0.5] which is gray. The color combination is based on light and not oil color.

Answered by Aria on May 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP