public class Main {
public static void main
(String[] args
) { // ANSI escape codes for colored output
String redText
= "\u001B[31m"; // Red color code String blueBackground
= "\u001B[44m"; // Blue background color code String resetColor
= "\u001B[0m"; // Reset color code
// Print "Hello, World" in red with a blue background
System.
out.
println(blueBackground
+ redText
+ "\n\n Hello, World \n\n" + resetColor
);
// Display the color key
System.
out.
println("\nColor Key:"); System.
out.
println(redText
+ "Red Text" + resetColor
); System.
out.
println(blueBackground
+ "Blue Background" + resetColor
); }
}
cHVibGljIGNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIC8vIEFOU0kgZXNjYXBlIGNvZGVzIGZvciBjb2xvcmVkIG91dHB1dAogICAgICAgIFN0cmluZyByZWRUZXh0ID0gIlx1MDAxQlszMW0iOyAvLyBSZWQgY29sb3IgY29kZQogICAgICAgIFN0cmluZyBibHVlQmFja2dyb3VuZCA9ICJcdTAwMUJbNDRtIjsgLy8gQmx1ZSBiYWNrZ3JvdW5kIGNvbG9yIGNvZGUKICAgICAgICBTdHJpbmcgcmVzZXRDb2xvciA9ICJcdTAwMUJbMG0iOyAvLyBSZXNldCBjb2xvciBjb2RlCgogICAgICAgIC8vIFByaW50ICJIZWxsbywgV29ybGQiIGluIHJlZCB3aXRoIGEgYmx1ZSBiYWNrZ3JvdW5kCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGJsdWVCYWNrZ3JvdW5kICsgcmVkVGV4dCArICJcblxuICAgSGVsbG8sIFdvcmxkICAgXG5cbiIgKyByZXNldENvbG9yKTsKICAgICAgICAKICAgICAgCiAgICAgICAgCiAgICAgICAgLy8gRGlzcGxheSB0aGUgY29sb3Iga2V5CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJcbkNvbG9yIEtleToiKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4ocmVkVGV4dCArICJSZWQgVGV4dCIgKyByZXNldENvbG9yKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oYmx1ZUJhY2tncm91bmQgKyAiQmx1ZSBCYWNrZ3JvdW5kIiArIHJlc2V0Q29sb3IpOwogICAgfQp9Cg==