About 81,300 results
Open links in new tab
  1. java - Convert a RGB Color Value to a Hexadecimal String - Stack …

    Jun 12, 2020 · A one liner but without String.format for all RGB colors: Color your_color = new Color(128,128,128); String hex = "#"+Integer.toHexString(your_color.getRGB()).substring(2); …

  2. colors - How to convert hex to rgb using Java? - Stack Overflow

    Nov 9, 2010 · A hex color code is #RRGGBB. RR, GG, BB are hex values ranging from 0-255. Let's call RR XY where X and Y are hex character 0-9A-F, A=10, F=15

  3. How to add RGB values into setColor() in Java? - Stack Overflow

    May 29, 2018 · I want to give my rectangle a color using RGB values like (200, 200, 200) for example; that'll be like a ...

  4. How do i convert RGB color to hexadecimal in Java

    Mar 14, 2020 · RR, GG, BB each represent a value between 0 - 255 (the RGB-values). Each digit of the hex-number can have values ranging from 0 - 16, means that you will need to store …

  5. java - Convert RGB to Hexadecimal - Stack Overflow

    Jan 20, 2014 · How to convert hex to rgb using Java? 17. How to get RGB value from hexadecimal color code in java. 5.

  6. java - Bit Shift and Bitwise operations to encode RGB values

    Oct 9, 2013 · I would like to encode the RGB color to a single integer value. Let's say the algorithm for encoding is like this: int code = (blue * 256 * 256) + (green * 256) + red How can …

  7. java - Convert color RGB to HEX (int result) - Stack Overflow

    I've created a method that convert three integer values to an hex value (string), as you can see below (P.S.: it was not been tested yet): protected String convertRGBToHex(int r, int g, int b) { ...

  8. java - Convert RGB values to color name - Stack Overflow

    Feb 5, 2018 · Hmm, that's a kind of fun problem. I can think of a few solutions: You could do a bit of guesswork depending on the relationships between the R-G-B values (for example, if one …

  9. java - From RGBA to Hex - Stack Overflow

    Jul 25, 2013 · To Convert rgba to Hexa color: This function you can use, rgba value is for example : rgba(255,249,249,0.54) ...

  10. How to get RGB value from hexadecimal color code in java

    Sep 15, 2011 · The first two letters are the color red. The next two are green and the two latest letters are for the color blue. So When you have the hex-code of the color red you must …

Refresh