For some reason rgb(0,0,0) is returning red for me. The Mac color picker utility says it's shade rgb(248, 118, 109). I have my maxColorValue properly set, but that shouldn't matter for rgb(0,0,0). I'm stumped as to what's going wrong. The only thing I can think of is that somehow there is a k channel that is messed up but I haven't found an option for it in the rgb() function.
library(tidyverse)
cars %>%
filter(speed < 5) %>%
mutate(time = dist / speed) %>%
group_by(time, dist, speed) %>%
ggplot(aes(x = dist, y = speed, fill = rgb(0,0,0))) +
geom_tile() +
facet_grid(~time)