47
47
// minimal tolerated values of font color before a white background is rendered
48
48
static REAL sr_minR = .5, sr_minG = .5, sr_minB =.5, sr_minTotal = .7;
49
tConfItem< REAL > sr_minRConf( "FONT_MIN_R", sr_minR );
50
tConfItem< REAL > sr_minGConf( "FONT_MIN_G", sr_minG );
51
tConfItem< REAL > sr_minBConf( "FONT_MIN_B", sr_minB );
52
tConfItem< REAL > sr_minTotalConf( "FONT_MIN_TOTAL", sr_minTotal );
49
tSettingItem< REAL > sr_minRConf( "FONT_MIN_R", sr_minR );
50
tSettingItem< REAL > sr_minGConf( "FONT_MIN_G", sr_minG );
51
tSettingItem< REAL > sr_minBConf( "FONT_MIN_B", sr_minB );
52
tSettingItem< REAL > sr_minTotalConf( "FONT_MIN_TOTAL", sr_minTotal );
54
54
// *******************************************************************************************
158
158
r_ = CTR( hex_to_int( c[2] ) *16 + hex_to_int( c[3] ) );
159
159
g_ = CTR( hex_to_int( c[4] ) *16 + hex_to_int( c[5] ) );
160
160
b_ = CTR( hex_to_int( c[6] ) *16 + hex_to_int( c[7] ) );
163
// strict checking: accept only 0-9 and a-f. Network aware config item is in nNetwork.cpp.
164
bool st_verifyColorCodeStrictly = 0;
166
static bool st_verifyColorChar( int c )
168
if( st_verifyColorCodeStrictly )
170
// really check for valid hexcodes
171
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
175
// be content with ASCII.
176
return (0 < c) && (c <= 0x7f);
180
// *******************************************************************************************
184
// *******************************************************************************************
186
//! @param c Color code string to read the color from
188
// *******************************************************************************************
190
bool tColor::VerifyColorCode( const char * c )
192
for( int i = 2; i < 8; ++i )
194
if ( !st_verifyColorChar(c[i]) )
202
// *******************************************************************************************
206
// *******************************************************************************************
208
//! @param c Color code string to read the color from
210
// *******************************************************************************************
212
bool tColor::VerifyColorCode( const wchar_t * c )
214
for( int i = 2; i < 8; ++i )
216
if ( !st_verifyColorChar(c[i]) )
163
// strict checking: accept only 0-9 and a-f. Network aware config item is in nNetwork.cpp.
164
bool st_verifyColorCodeStrictly = 0;
166
static bool st_verifyColorChar( int c )
168
if( st_verifyColorCodeStrictly )
170
// really check for valid hexcodes
171
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
175
// be content with ASCII.
176
return (0 < c) && (c <= 0x7f);
180
// *******************************************************************************************
184
// *******************************************************************************************
186
//! @param c Color code string to read the color from
188
// *******************************************************************************************
190
bool tColor::VerifyColorCode( const char * c )
192
for( int i = 2; i < 8; ++i )
194
if ( !st_verifyColorChar(c[i]) )
202
// *******************************************************************************************
206
// *******************************************************************************************
208
//! @param c Color code string to read the color from
210
// *******************************************************************************************
212
bool tColor::VerifyColorCode( const wchar_t * c )
214
for( int i = 2; i < 8; ++i )
216
if ( !st_verifyColorChar(c[i]) )
224
224
// *******************************************************************************************