mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 17:29:51 +00:00
Add methods for extracting red, green and blue color portions from an int color.
This commit is contained in:
parent
a8efe538c1
commit
aee3fba9cf
2 changed files with 50 additions and 0 deletions
|
@ -110,4 +110,19 @@ public class Style implements Serializable
|
|||
{
|
||||
return (0xFF << 24) | (red << 16) | (green << 8) | blue;
|
||||
}
|
||||
|
||||
public static int red(final int color)
|
||||
{
|
||||
return (color >> 16) & 0xff;
|
||||
}
|
||||
|
||||
public static int green(final int color)
|
||||
{
|
||||
return (color >> 8) & 0xff;
|
||||
}
|
||||
|
||||
public static int blue(final int color)
|
||||
{
|
||||
return color & 0xff;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue