PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Utility
libcolormath
compareRRGGBB.c
1
/*
2
* @file compareRRGGBB.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
compareRRGGBB(
int
c1,
int
c2)
20
{
21
return
255 - ((abs(((c1 & 0xFF0000) >> 16) - ((c2 & 0xFF0000) >> 16)) + abs(((c1 & 0xFF00) >> 8) - ((c2 & 0xFF00) >> 8)) + abs((c1 & 0xFF) - (c2 & 0xFF))) / 3);
22
}
23
24
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17