From 894f2f20d7e88516bde7fb0d6db5cf6da91637a6 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 14 Jul 2023 07:08:51 +0300 Subject: [PATCH] Improved code readability --- .../sixth/e3d/renderer/raster/Color.java | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java index a78192d..0743cf0 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java @@ -15,13 +15,25 @@ public final class Color { public static final Color PURPLE = new Color(255, 0, 255, 255); public static final Color TRANSPARENT = new Color(0, 0, 0, 0); - public final int r, g, b; + /** + * Red component. 0-255. + */ + public final int r; + + /** + * Green component. 0-255. + */ + public final int g; + + /** + * Blue component. 0-255. + */ + public final int b; /** - *
-     * 255 is opaque.
-     * 0 is transparent.
-     * 
+ * Alpha component. + * 0 - transparent. + * 255 - opaque. */ public int a; @@ -40,14 +52,14 @@ public final class Color { } /** - *
-     *     Supported formats are:
-     *
-     *     RGB
-     *     RGBA
-     *     RRGGBB
-     *     RRGGBBAA
-     * 
+ * @param colorHexCode color code in hex format. + * Supported formats are: + *
+     *                     RGB
+     *                     RGBA
+     *                     RRGGBB
+     *                     RRGGBBAA
+     *                     
*/ public Color(String colorHexCode) { switch (colorHexCode.length()) { -- 2.20.1