1 // 2 // Copyright (c) 2016 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // Color.h : Defines the Color type used throughout the ANGLE libraries 8 9 #ifndef COMMON_COLOR_H_ 10 #define COMMON_COLOR_H_ 11 12 namespace angle 13 { 14 15 template <typename T> 16 struct Color 17 { 18 T red; 19 T green; 20 T blue; 21 T alpha; 22 23 Color(); 24 Color(T r, T g, T b, T a); 25 }; 26 27 template <typename T> 28 bool operator==(const Color<T> &a, const Color<T> &b); 29 30 template <typename T> 31 bool operator!=(const Color<T> &a, const Color<T> &b); 32 33 typedef Color<float> ColorF; 34 typedef Color<int> ColorI; 35 typedef Color<unsigned int> ColorUI; 36 37 } // namespace angle 38 39 // TODO: Move this fully into the angle namespace 40 namespace gl 41 { 42 43 template <typename T> 44 using Color = angle::Color<T>; 45 using ColorF = angle::ColorF; 46 using ColorI = angle::ColorI; 47 using ColorUI = angle::ColorUI; 48 49 } // namespace gl 50 51 #include "Color.inl" 52 53 #endif // COMMON_COLOR_H_ 54