building a hex value from integers

Posted by StillLearningToCode on Stack Overflow See other posts from Stack Overflow or by StillLearningToCode
Published on 2014-08-24T04:10:59Z Indexed on 2014/08/24 4:20 UTC
Read the original article Hit count: 75

Filed under:

i am trying to generate a hex color value from an integer input, and I'm not sure I'm using the concat method correctly. when i output the string theColor, i only get "0x", any ideas?

public String generateColor(String redVal, String blueVal, 
  String greenVal, String alphaVal){
      String theColor = "0x";

      theColor.concat(alphaVal);
      theColor.concat(redVal);
      theColor.concat(greenVal);
      theColor.concat(blueVal);

      return theColor;
}  

© Stack Overflow or respective owner

Related posts about java