color.h - Engine C API Reference

color.h
  1. #pragma once
  2. #include "platform.h"
  3. namespace stingray_plugin_foundation {
  4. typedef unsigned int Color8;
  5. __forceinline Color8 color8(unsigned char a, unsigned char r, unsigned char g, unsigned char b)
  6. {
  7. return (a << 24) | (r << 16) | (g << 8) | b;
  8. }
  9. __forceinline unsigned char alpha(Color8 c) {return (c >> 24) & 0xff;}
  10. __forceinline unsigned char red(Color8 c) {return (c >> 16) & 0xff;}
  11. __forceinline unsigned char green(Color8 c) {return (c >> 8) & 0xff;}
  12. __forceinline unsigned char blue(Color8 c) {return (c >> 0) & 0xff;}
  13. struct Color32 {
  14. float r, g, b, a;
  15. };
  16. } // namespace stingray_plugin_foundation