color extracted, null check added