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
Branches
No related tags found
No related merge requests found
......@@ -17,15 +17,13 @@ public class Palette extends HttpServlet
out.println("<center>Palette<table>");
final String HEX = "0123456789abcdef";
for (int x = 0; x < HEX.length(); ++x) {
for (int x = 0; x < 16; ++x) {
out.println("<tr>");
for (int y = 0; y < HEX.length(); ++y) {
char blue = HEX.charAt(x);
char green = HEX.charAt(y);
out.println(String.format("<td style=\"width: 1em;height:1em;background: #0%c%c\"></td>", green, blue));
for (int y = 0; y < 16; ++y) {
String blue = Integer.toHexString(x);
String green = Integer.toHexString(y);
out.println(String.format("<td style=\"width: 1em;height:1em;background: #0%s%s\"></td>", green, blue));
}
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