Skip to content

Commit

Permalink
Fix incorrect hashtag prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
silentsoft committed Feb 17, 2022
1 parent bf65a3a commit a4e9986
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/silentsoft/badge4j/Badge.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.silentsoft.badge4j;

import org.silentsoft.csscolor4j.Color;

public class Badge {

private BadgeBuilder badgeBuilder;
Expand All @@ -21,15 +23,15 @@ String build() {
color = color.trim();
color = (NamedColor.nameOf(color) != null) ? NamedColor.nameOf(color).getHex() : (NamedColorAlias.nameOf(color) != null) ? NamedColorAlias.nameOf(color).getHex() : color;
if (color.startsWith("#") == false && org.silentsoft.csscolor4j.NamedColor.nameOf(color) == null) {
color = "#".concat(color);
color = Color.valueOf(color).getHex();
}
}
String labelColor = (badgeBuilder.labelColor != null && badgeBuilder.labelColor.length() > 0) ? badgeBuilder.labelColor : "#555";
{
labelColor = labelColor.trim();
labelColor = (NamedColor.nameOf(labelColor) != null) ? NamedColor.nameOf(labelColor).getHex() : (NamedColorAlias.nameOf(labelColor) != null) ? NamedColorAlias.nameOf(labelColor).getHex() : labelColor;
if (labelColor.startsWith("#") == false && org.silentsoft.csscolor4j.NamedColor.nameOf(labelColor) == null) {
labelColor = "#".concat(labelColor);
labelColor = Color.valueOf(labelColor).getHex();
}
}
String[] links = badgeBuilder.links;
Expand Down

0 comments on commit a4e9986

Please sign in to comment.