Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 793372e

Browse files
committed
Update EmbedColor.java
1 parent e9f42ed commit 793372e

File tree

2 files changed

+20
-33
lines changed

2 files changed

+20
-33
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "ru.sal4i"
7-
version = "1.0.3-SNAPSHOT"
7+
version = "1.1"
88

99
repositories {
1010
mavenCentral()
@@ -24,7 +24,7 @@ publishing {
2424
create<MavenPublication>("maven") {
2525
groupId = "com.github.Sal4iDev"
2626
artifactId = "sDiscordWebhookJava"
27-
version = "1.0"
27+
version = "1.1"
2828

2929
from(components["java"])
3030
}

src/main/java/ru/sal4i/sdiscordwebhook/EmbedColor.java

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
* @see AlphaComposite
3535
*/
3636
@SuppressWarnings("unused")
37+
38+
/*
39+
This class is almost a full copy of java.awt.Color
40+
I had to do this because this API is more for VisualBukkit
41+
And there, there is no difference between org.bukkit.Color and java.awt.Color
42+
Sorry for the inconvenience!
43+
*/
3744
public class EmbedColor implements Paint, java.io.Serializable {
3845

3946
/**
@@ -308,8 +315,7 @@ public EmbedColor(int r, int g, int b, int a) {
308315
value = ((a & 0xFF) << 24) |
309316
((r & 0xFF) << 16) |
310317
((g & 0xFF) << 8) |
311-
// ((b & 0xFF) << 0);
312-
((b & 0xFF)); // sal4idev
318+
((b & 0xFF) << 0);
313319
testColorValueRange(r, g, b, a);
314320
}
315321

@@ -1201,42 +1207,16 @@ public ColorSpace getColorSpace() {
12011207
return cs;
12021208
}
12031209

1204-
// /**
1205-
// * Creates and returns a {@link PaintContext} used to
1206-
// * generate a solid color field pattern.
1207-
// * See the {@link Paint#createContext specification} of the
1208-
// * method in the {@link Paint} interface for information
1209-
// * on null parameter handling.
1210-
// *
1211-
// * @param cm the preferred {@link ColorModel} which represents the most convenient
1212-
// * format for the caller to receive the pixel data, or {@code null}
1213-
// * if there is no preference.
1214-
// * @param r the device space bounding box
1215-
// * of the graphics primitive being rendered.
1216-
// * @param r2d the user space bounding box
1217-
// * of the graphics primitive being rendered.
1218-
// * @param xform the {@link AffineTransform} from user
1219-
// * space into device space.
1220-
// * @param hints the set of hints that the context object can use to
1221-
// * choose between rendering alternatives.
1222-
// * @return the {@code PaintContext} for
1223-
// * generating color patterns.
1224-
// * @see Paint
1225-
// * @see PaintContext
1226-
// * @see ColorModel
1227-
// * @see Rectangle
1228-
// * @see Rectangle2D
1229-
// * @see AffineTransform
1230-
// * @see RenderingHints
1231-
// */
1210+
// Sal4iDev start.
12321211
public synchronized PaintContext createContext(ColorModel cm, Rectangle r,
12331212
Rectangle2D r2d,
12341213
AffineTransform xform,
12351214
RenderingHints hints) {
12361215
// return new java.awt.ColorPaintContext(getRGB(), cm);
1237-
return null;
1216+
return null; // Sal4iDev
12381217
}
12391218

1219+
// Sal4iDev end.
12401220

12411221
/**
12421222
* Returns the transparency mode for this {@code EmbedColor}. This is
@@ -1259,3 +1239,10 @@ public int getTransparency() {
12591239
}
12601240

12611241
}
1242+
1243+
/*
1244+
This class is almost a full copy of java.awt.Color
1245+
I had to do this because this API is more for VisualBukkit
1246+
And there, there is no difference between org.bukkit.Color and java.awt.Color
1247+
Sorry for the inconvenience!
1248+
*/

0 commit comments

Comments
 (0)