src/Helpers.c
bool VerifyContrast(COLORREF cr1,COLORREF cr2)
{
  BYTE r1 = GetRValue(cr1);
  BYTE g1 = GetGValue(cr1);
  BYTE b1 = GetBValue(cr1);
  BYTE r2 = GetRValue(cr2);
  BYTE g2 = GetGValue(cr2);
  BYTE b2 = GetBValue(cr2);

  return(
    ((abs((3*r1 + 5*g1 + 1*b1) - (3*r2 + 6*g2 + 1*b2))) >= 400) ||
    ((abs(r1-r2) + abs(b1-b2) + abs(g1-g2)) >= 400));
}
//=============================================================================
//
//  VerifyContrast()
//  Check if two colors can be distinguished
//
VerifyContrast()
Check if two colors can be distinguished
VerifyContrast () Check if two colors can be distinguished
bool VerifyContrast(COLORREF cr1,COLORREF cr2)
{
  BYTE r1 = GetRValue(cr1);
  BYTE g1 = GetGValue(cr1);
  BYTE b1 = GetBValue(cr1);
  BYTE r2 = GetRValue(cr2);
  BYTE g2 = GetGValue(cr2);
  BYTE b2 = GetBValue(cr2);
  return(
    ((abs((3*r1 + 5*g1 + 1*b1) - (3*r2 + 6*g2 + 1*b2))) >= 400) ||
    ((abs(r1-r2) + abs(b1-b2) + abs(g1-g2)) >= 400));
}
bool VerifyContrast ( COLORREF cr1 , COLORREF cr2 ) { BYTE r1 = GetRValue ( cr1 ) ; BYTE g1 = GetGValue ( cr1 ) ; BYTE b1 = GetBValue ( cr1 ) ; BYTE r2 = GetRValue ( cr2 ) ; BYTE g2 = GetGValue ( cr2 ) ; BYTE b2 = GetBValue ( cr2 ) ; return ( ( ( abs ( ( 3 * r1 + 5 * g1 + 1 * b1 ) - ( 3 * r2 + 6 * g2 + 1 * b2 ) ) ) >= 400 ) || ( ( abs ( r1 - r2 ) + abs ( b1 - b2 ) + abs ( g1 - g2 ) ) >= 400 ) ) ; }
VerifyContrast()
Check if two colors can be distinguished
VerifyContrast () Check if two colors can be distinguished