Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pattern color = Pattern.compile("(?i).*BACKGROUND=(\\d+),(\\d+),(\\d+).*");
- Matcher m = color.matcher("bla-bla-bla background=100,150,200 FONT=bold");
- int r = 255, g = 255, b =255;
- if ((m.find() && m.groupCount() == 3)) {
- r = NumberFunctions.findInteger(m.group(1), 255);
- g = NumberFunctions.findInteger(m.group(2), 255);
- b = NumberFunctions.findInteger(m.group(3), 255);
- }
- Color background = new Color(r,g,b);
- System.out.println(r + "," + g + "," + b);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement