1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-29 07:29:00 +00:00
This commit is contained in:
Arnaud Roques 2022-01-01 18:05:19 +01:00
parent 3cbd4924f2
commit 4a8e9e6e2e
3 changed files with 19 additions and 23 deletions

View File

@ -72,8 +72,8 @@ import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagram> {
private static final String CODE = CommandLinkClass.getSeparator() + "?[%pLN_]+" + "(?:"
+ CommandLinkClass.getSeparator() + "[%pLN_]+)*";
private static final String CODE = CommandLinkClass.getSeparator() + "?[%pLN_$]+" + "(?:"
+ CommandLinkClass.getSeparator() + "[%pLN_$]+)*";
public static final String CODES = CODE + "(?:\\s*,\\s*" + CODE + ")*";
enum Mode {

View File

@ -323,20 +323,19 @@ public class HSLColor {
* @return the RGB Color object
*/
public static Color toRGB(float h, float s, float l, float alpha) {
if (s < 0.0f || s > 100.0f) {
String message = "Color parameter outside of expected range - Saturation";
throw new IllegalArgumentException(message);
}
if (l < 0.0f || l > 100.0f) {
String message = "Color parameter outside of expected range - Luminance";
throw new IllegalArgumentException(message);
}
if (alpha < 0.0f || alpha > 1.0f) {
String message = "Color parameter outside of expected range - Alpha";
throw new IllegalArgumentException(message);
}
if (s < 0)
s = 0;
if (s > 100)
s = 100;
if (l < 0)
l = 0;
if (l > 100)
l = 100;
if (alpha < 0)
alpha = 0;
if (alpha > 1)
alpha = 1;
// Formula needs all values between 0 - 1.
@ -372,17 +371,14 @@ public class HSLColor {
if (h > 1)
h -= 1;
if (6 * h < 1) {
if (6 * h < 1)
return p + ((q - p) * 6 * h);
}
if (2 * h < 1) {
if (2 * h < 1)
return q;
}
if (3 * h < 2) {
if (3 * h < 2)
return p + ((q - p) * 6 * ((2.0f / 3.0f) - h));
}
return p;
}

View File

@ -80,7 +80,7 @@ public class Version {
}
public static int beta() {
final int beta = 4;
final int beta = 5;
return beta;
}