Fixed darkness function