PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Utility
libcolormath
get8bitColor.c
1
/*
2
* @file get8bitColor.c
3
*
4
* @author Matthew Matz
5
*
6
* @version 0.9
7
*
8
* @copyright Copyright (C) Parallax, Inc. 2016. See end of file for
9
* terms of use (MIT License).
10
*
11
* @brief This library contains a set of functions to make color space manipulation and math easier.
12
*/
13
14
15
16
#include "colormath.h"
17
18
19
int
get8bitColor(
int
c,
char
*i)
20
{
21
int
j = 0;
22
if
(i[0] ==
'R'
) j = 16;
23
if
(i[0] ==
'G'
) j = 8;
24
return
(c & (0xFF << j)) >> j;
25
}
26
27
28
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17