Fix for when working with nested color functions

Appears to have been attempting to convert `arg.value`, instead of arg which is undefined until set.

My understanding of the code here is reasonably limited. Was `arg.value` perhaps intentional, and in that case should it be attempting to handle both `arg` and `arg.value` here?

Hope this helps :) Thanks!