The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan
This commit is contained in:
parent
06419d4deb
commit
12b927e2ae
|
@ -15,6 +15,6 @@ public class Number0xff {
|
|||
}
|
||||
|
||||
public static int getAlfa(int rgba) {
|
||||
return rgba >> rgba & 0xff;
|
||||
return rgba & 0xff;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class Number0xffUnitTest {
|
|||
@Test
|
||||
public void givenColor_whenGetRedColor_thenExtractRedColor() {
|
||||
int rgba = 272214023;
|
||||
int expectedValue = 64;
|
||||
int expectedValue = 16;
|
||||
assertEquals(Number0xff.getRedColor(rgba), expectedValue);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue