Flutter Engine
The Flutter Engine
color_utils.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_COLOR_UTILS_H_
6#define BASE_COLOR_UTILS_H_
7
8/** Returns alpha byte from color value.
9 */
10#define ColorGetA(color) (((color) >> 24) & 0xFF)
11
12/** Returns red component of color, from zero to 255.
13 */
14#define ColorGetR(color) (((color) >> 16) & 0xFF)
15
16/** Returns green component of color, from zero to 255.
17 */
18#define ColorGetG(color) (((color) >> 8) & 0xFF)
19
20/** Returns blue component of color, from zero to 255.
21 */
22#define ColorGetB(color) (((color) >> 0) & 0xFF)
23
24#endif // BASE_COLOR_UTILS_H_