earthlike: fix bug in color calculations that could lead to a segfault