Skip to content
Snippets Groups Projects
Commit 1bbb91dc authored by Amaury Vanoorenberghe's avatar Amaury Vanoorenberghe :scroll:
Browse files

FIX - La servlet Palette utilise maintenant Integer.toHexString et non

plus une String constante et charAt
parent 7c0322fc
No related branches found
No related tags found
No related merge requests found
...@@ -17,15 +17,13 @@ public class Palette extends HttpServlet ...@@ -17,15 +17,13 @@ public class Palette extends HttpServlet
out.println("<center>Palette<table>"); out.println("<center>Palette<table>");
final String HEX = "0123456789abcdef"; for (int x = 0; x < 16; ++x) {
for (int x = 0; x < HEX.length(); ++x) {
out.println("<tr>"); out.println("<tr>");
for (int y = 0; y < HEX.length(); ++y) { for (int y = 0; y < 16; ++y) {
char blue = HEX.charAt(x); String blue = Integer.toHexString(x);
char green = HEX.charAt(y); String green = Integer.toHexString(y);
out.println(String.format("<td style=\"width: 1em;height:1em;background: #0%c%c\"></td>", green, blue)); out.println(String.format("<td style=\"width: 1em;height:1em;background: #0%s%s\"></td>", green, blue));
} }
out.println("</tr></center>"); out.println("</tr></center>");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment