MCPcopy Create free account
hub / github.com/DISTRHO/DPF / isEqual

Method isEqual

dgl/src/Color.cpp:268–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266// -----------------------------------------------------------------------
267
268bool Color::isEqual(const Color& color, const bool withAlpha) noexcept
269{
270 const uchar r1 = getFixedRange2(rgba[0]);
271 const uchar g1 = getFixedRange2(rgba[1]);
272 const uchar b1 = getFixedRange2(rgba[2]);
273 const uchar a1 = getFixedRange2(rgba[3]);
274
275 const uchar r2 = getFixedRange2(color.rgba[0]);
276 const uchar g2 = getFixedRange2(color.rgba[1]);
277 const uchar b2 = getFixedRange2(color.rgba[2]);
278 const uchar a2 = getFixedRange2(color.rgba[3]);
279
280 if (withAlpha)
281 return (r1 == r2 && g1 == g2 && b1 == b2 && a1 == a2);
282 else
283 return (r1 == r2 && g1 == g2 && b1 == b2);
284}
285
286bool Color::isNotEqual(const Color& color, const bool withAlpha) noexcept
287{

Callers 1

mainFunction · 0.80

Calls 1

getFixedRange2Function · 0.85

Tested by

no test coverage detected