example/main.c
// Simple hue function for generation of smooth rainbow.
Simple hue function for generation of smooth rainbow.
Simple hue function for generation of smooth rainbow .
static uint8_t hueval(int value) {
  value = value % 1536;
  if (value < 256) {
    return (uint8_t) value;
  } else if (value < 768) {
    return 255;
  } else if (value < 1024) {
    return (uint8_t)(1023 - value);
  } else {
    return 0;
  }
}
static uint8_t hueval ( int value ) { value = value % 1536 ; if ( value < 256 ) { return ( uint8_t ) value ; } else if ( value < 768 ) { return 255 ; } else if ( value < 1024 ) { return ( uint8_t ) ( 1023 - value ) ; } else { return 0 ; } }
Simple hue function for generation of smooth rainbow.
Simple hue function for generation of smooth rainbow .