paint recent move tiles differently from pending ones

This commit is contained in:
Eric House 2024-02-29 16:52:48 -08:00
parent fd26763ea5
commit be47bbcc81

View file

@ -405,10 +405,8 @@ public class BoardCanvas extends Canvas implements DrawCtx {
backColor = m_bonusColors[bonus]; backColor = m_bonusColors[bonus];
bonusStr = m_bonusSummaries[bonus]; bonusStr = m_bonusSummaries[bonus];
} }
} else if ( pending || recent ) { } else if ( pending ) {
if ( pending ) { ++mPendingCount;
++mPendingCount;
}
if ( darkOnLight() ) { if ( darkOnLight() ) {
foreColor = WHITE; foreColor = WHITE;
backColor = BLACK; backColor = BLACK;
@ -418,6 +416,9 @@ public class BoardCanvas extends Canvas implements DrawCtx {
} }
} else { } else {
backColor = m_otherColors[CommonPrefs.COLOR_TILE_BACK]; backColor = m_otherColors[CommonPrefs.COLOR_TILE_BACK];
if ( recent ) {
backColor = shade( backColor );
}
} }
fillRect( rect, adjustColor( backColor ) ); fillRect( rect, adjustColor( backColor ) );
@ -923,6 +924,19 @@ public class BoardCanvas extends Canvas implements DrawCtx {
return null != m_fontDims; return null != m_fontDims;
} // figureFontDims } // figureFontDims
private int shade( int color )
{
int newColor = color & 0xFF000000; // keep the alpha
for ( int ii = 0; ii < 3; ++ii ) {
int byt = ((color >> (ii * 8)) & 0xFF);
byt = (byt + 0x7F) % 0xFF;
Assert.assertTrue( byt <= 255 );
newColor |= byt << (ii * 8);
}
Log.d( TAG, "shade(%x) => %x", color, newColor );
return newColor;
}
private int adjustColor( int color ) private int adjustColor( int color )
{ {
if ( m_inTrade ) { if ( m_inTrade ) {