Make position parameter a const reference, remove temporary variable
Fix color conversion