Skip to content

Commit bf70693

Browse files
committed
fix: update hex color format output to use rgb() notation
1 parent 487cf02 commit bf70693

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/CssColorUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static String hexToRgb(String color) {
2929
if (!HEX_RGB_PATTERN.matcher(color).matches()) {
3030
throw new IllegalArgumentException(String.format("Invalid hex rgb format %s", color));
3131
}
32-
return String.format("%s, %s, %s", Integer.valueOf(color.substring(1, 3), 16),
32+
return String.format("rgb(%s, %s, %s)", Integer.valueOf(color.substring(1, 3), 16),
3333
Integer.valueOf(color.substring(3, 5), 16), Integer.valueOf(color.substring(5, 7), 16));
3434
}
3535

spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/CssColorUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CssColorUtilsTest implements WithAssertions {
2424
@Test
2525
void hexToRgb() {
2626
assertThat(CssColorUtils.hexToRgb(new AdminServerUiProperties.Palette().getShade50()))
27-
.isEqualTo("238, 252, 250");
27+
.isEqualTo("rgb(238, 252, 250)");
2828
}
2929

3030
@Test

0 commit comments

Comments
 (0)