Skip to content

Instantly share code, notes, and snippets.

@DavidMellul
Created March 10, 2018 13:59
Show Gist options
  • Save DavidMellul/7105552d399a9b457dc51cf1bbed36d0 to your computer and use it in GitHub Desktop.
Save DavidMellul/7105552d399a9b457dc51cf1bbed36d0 to your computer and use it in GitHub Desktop.
var OPTIONS = {
'GRAYSCALE': 1, 'SEPIA': 2, 'HIGH-RES': 4, 'LOW-RES': 8
};
function setCameraSettings(options) {
if( options & OPTIONS['GRAYSCALE'] )
console.log('GRAYSCALE activated');
if( options & OPTIONS['SEPIA'] )
console.log('SEPIA activated');
// And so on
}
setCameraSettings( OPTIONS['GRAYSCALE'] | OPTIONS['SEPIA'] );
// => GRAYSCALE & SEPIA activated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment