Skip to content

Commit

Permalink
Merge branch 'improvement/ghi-#7-nord-public-api-javadoc-documentatio…
Browse files Browse the repository at this point in the history
…n' into develop
  • Loading branch information
arcticicestudio committed Dec 3, 2016
2 parents f241e8d + 67dcb4d commit 9eab580
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 77 deletions.
12 changes: 1 addition & 11 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 75 additions & 55 deletions src/main/java/com/arcticicestudio/nord/Nord.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title Nord API +
project nord-java +
version 0.1.0 +
repository https://github.com/arcticicestudio/nord-java +
author Arctic Ice Studio +
email development@arcticicestudio.com +
Expand All @@ -16,8 +15,14 @@ copyright Copyright (C) 2016 +
import java.util.regex.Pattern;

/**
* Public API entry point of the <a href="https://github.com/arcticicestudio/nord-java">Nord - Java</a> project, which
* implements the <a href="https://github.com/arcticicestudio/nord">Nord</a> color palette.
* A arctic, north-bluish color palette Java library.
* Created for the clean- and minimal flat design pattern to achieve a optimal focus and readability for code syntax
* highlighting and UI.
* It consists of a total of sixteen, carefully selected, dimmed pastel colors for a eye-comfortable, but yet colorful
* ambiance.
* <p>
* Public API entry point of the <a href="https://github.com/arcticicestudio/nord-java">Nord Java</a> project, which
* implements the <a href="https://github.com/arcticicestudio/nord">Nord</a> color palette.
*
* <div>
* <table summary="Nord Color Palette">
Expand Down Expand Up @@ -60,100 +65,114 @@ copyright Copyright (C) 2016 +
*/
public enum Nord {
/**
* The color {@code nord0} of the "Polar Night" component with an RGB value of {@code rgb(46, 52, 64)} and an HEX
* value of {@code #2E3440}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(46,52,64);margin: 0"></div>
* Base component color "{@code nord0}" of "Polar Night" with a RGB value of {@code rgb(46, 52, 64)} and a HEX value
* of {@code #2E3440}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(46,52,64);margin:0"></div>
*/
NORD0(46, 52, 64),

/**
* The color {@code nord1} of the "Polar Night" component with an RGB value of {@code rgb(59, 66, 82)} and an HEX
* value of {@code #3B4252}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(59,66,82);margin: 0"></div>
* Brighter color "{@code nord1}" of the "Polar Night" component base color {@link #NORD0} with a RGB value of
* {@code rgb(59, 66, 82)} and a HEX value of {@code #3B4252}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(59,66,82);margin:0"></div>
*/
NORD1(59, 66, 82),

/**
* The color {@code nord2} of the "Polar Night" component with an RGB value of {@code rgb(67, 76, 94)} and an HEX
* value of {@code #434C5E}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(67,76,94);margin: 0"></div>
* Brighter color "{@code nord2}" of the "Polar Night" component base color {@link #NORD0} with a RGB value of
* {@code rgb(67, 76, 94)} and a HEX value of {@code #434C5E}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(67,76,94);margin:0"></div>
*/
NORD2(67, 76, 94),

/**
* The color {@code nord3} of the "Polar Night" component with an RGB value of {@code rgb(76, 86, 106)} and an HEX
* value of {@code #4C566A}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(76,86,106);margin: 0"></div>
* Brighter color "{@code nord3}" of the "Polar Night" component base color {@link #NORD0} with a RGB value of
* {@code rgb(76, 86, 106)} and a HEX value of {@code #4C566A}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(76,86,106);margin:0"></div>
*/
NORD3(76, 86, 106),

/**
* The color {@code nord4} of the "Snow Storm" component with an RGB value of {@code rgb(216, 222, 233)} and an HEX
* value of {@code #D8DEE9}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(216,222,233);margin: 0"></div>
* Base component color "{@code nord4}" of "Snow Storm" with a RGB value of {@code rgb(216, 222, 233)} and a HEX value
* of {@code #D8DEE9}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(216,222,233);margin:0"></div>
*/
NORD4(216, 222, 233),

/**
* The color {@code nord5} of the "Snow Storm" component with an RGB value of {@code rgb(229, 233, 240)} and an HEX
* value of {@code #E5E9F0}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(229,233,240);margin: 0"></div>
* Brighter color "{@code nord5}" of the "Snow Storm" component base color {@link #NORD4} with a RGB value of
* {@code rgb(229, 233, 240)} and a HEX value of {@code #E5E9F0}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(229,233,240);margin:0"></div>
*/
NORD5(229, 233, 240),

/**
* The color {@code nord6} of the "Snow Storm" component with an RGB value of {@code rgb(236, 239, 244)} and an HEX
* value of {@code #ECEFF4}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(236,239,244);margin: 0"></div>
* Brighter color "{@code nord6}" of the "Snow Storm" component base color {@link #NORD4} with a RGB value of
* {@code rgb(236, 239, 244)} and a HEX value of {@code #ECEFF4}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(236,239,244);margin:0"></div>
*/
NORD6(236, 239, 244),

/**
* The color {@code nord7} of the "Frost" component with an RGB value of {@code rgb(143, 188, 187)} and an HEX
* value of {@code #8FBCBB}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(143,188,187);margin: 0"></div>
* Bluish core color "{@code nord7}" of the "Frost" component with a RGB value of {@code rgb(143, 188, 187)} and a
* HEX value of {@code #8FBCBB}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(143,188,187);margin:0"></div>
*/
NORD7(143, 188, 187),

/**
* The color {@code nord8} of the "Frost" component with an RGB value of {@code rgb(136, 192, 208)} and an HEX
* value of {@code #88C0D0}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(136,192,208);margin: 0"></div>
* Bluish core accent color "{@code nord8}" of the "Frost" component with a RGB value of {@code rgb(136, 192, 208)}
* and a HEX value of {@code #88C0D0}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(136,192,208);margin:0"></div>
*/
NORD8(136, 192, 208),

/**
* The color {@code nord9} of the "Frost" component with an RGB value of {@code rgb(129, 161, 193)} and an HEX
* value of {@code #81A1C1}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(129,161,193);margin: 0"></div>
* Bluish core color "{@code nord9}" of the "Frost" component with a RGB value of {@code rgb(129, 161, 193)} and a
* HEX value of {@code #81A1C1}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(129,161,193);margin:0"></div>
*/
NORD9(129, 161, 193),

/**
* The color {@code nord10} of the "Frost" component with an RGB value of {@code rgb(94, 129, 172)} and an HEX
* value of {@code #5E81AC}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(94,129,172);margin: 0"></div>
* Bluish core color "{@code nord10}" of the "Frost" component with a RGB value of {@code rgb(94, 129, 172)} and a
* HEX value of {@code #5E81AC}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(94,129,172);margin:0"></div>
*/
NORD10(94, 129, 172),

/**
* The color {@code nord11} of the "Aurora" component with an RGB value of {@code rgb(191, 97, 106)} and an HEX
* value of {@code #BF616A}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(191,97,106);margin: 0"></div>
* Colorful color "{@code nord11}" of the "Aurora" component with a RGB value of {@code rgb(191, 97, 106)} and a
* HEX value of {@code #BF616A}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(191,97,106);margin:0"></div>
*/
NORD11(191, 97, 106),

/**
* The color {@code nord12} of the "Aurora" component with an RGB value of {@code rgb(208, 135, 112)} and an HEX
* value of {@code #D08770}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(208,135,112);margin: 0"></div>
* Colorful color "{@code nord12}" of the "Aurora" component with a RGB value of {@code rgb(208, 135, 112)} and a
* HEX value of {@code #D08770}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(208,135,112);margin:0"></div>
*/
NORD12(208, 135, 112),

/**
* The color {@code nord13} of the "Aurora" component with an RGB value of {@code rgb(235, 203, 139)} and an HEX
* value of {@code #EBCB8B}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(235,203,139);margin: 0"></div>
* Colorful color "{@code nord13}" of the "Aurora" component with a RGB value of {@code rgb(235, 203, 139)} and a
* HEX value of {@code #EBCB8B}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(235,203,139);margin:0"></div>
*/
NORD13(235, 203, 139),

Expand All @@ -165,19 +184,20 @@ public enum Nord {
NORD14(163, 190, 140),

/**
* The color {@code nord15} of the "Aurora" component with an RGB value of {@code rgb(180, 142, 173)} and an HEX
* value of {@code #B48EAD}.
* <div style="border:none;width:25px;height:30px;background-color:rgb(180,142,173);margin: 0"></div>
* Colorful color "{@code nord15}" of the "Aurora" component with a RGB value of {@code rgb(180, 142, 173)} and a
* HEX value of {@code #B48EAD}.
* <p>
* <div style="border:none;width:25px;height:25px;background-color:rgb(180,142,173);margin:0"></div>
*/
NORD15(180, 142, 173);

/**
* Compiled pattern to convert the RGB and HEX color values.
* Prefix pattern to convert RGB- and HEX color values.
*/
private static final Pattern COLOR_PREFIX = Pattern.compile("0x", Pattern.LITERAL);

/**
* Contains the RGB color code.
* The RGB color code.
*/
private final Color COLOR;

Expand All @@ -193,19 +213,19 @@ public enum Nord {
}

/**
* Converts the {@code color} to the HEX identifier.
* Converts the specified color to the HEX identifier.
*
* @param color the color object
* @param color the color object to convert
* @return the string representation of the HEX identifier
*/
public static String hex(final Color color) {
return COLOR_PREFIX.matcher(color.toString()).replaceAll("#").substring(0, 7).toUpperCase();
}

/**
* Converts the {@code color} to the RGB identifier.
* Converts the specified color to the RGB identifier.
*
* @param color the color object
* @param color the color object to convert
* @return the string representation of the RGB identifier
*/
public static String rgb(final Color color) {
Expand All @@ -222,7 +242,7 @@ public static String rgb(final Color color) {
}

/**
* Returns the color object.
* The color constant as color object.
*
* @return the color object
*/
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/com/arcticicestudio/nord/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title Nord API Package Info +
project nord-java +
version 0.1.0 +
repository https://github.com/arcticicestudio/nord-java +
author Arctic Ice Studio +
email development@arcticicestudio.com +
copyright Copyright (C) 2016 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
/**
* Public API of the <a href="https://github.com/arcticicestudio/nord-java">Nord - Java</a> project, which implements
* Public API of the <a href="https://github.com/arcticicestudio/nord-java">Nord Java</a> project, which implements
* the <a href="https://github.com/arcticicestudio/nord">Nord</a> color palette.
*
* <p>
* The main entry point of the API is the {@link com.arcticicestudio.nord.Nord} enum.
* </p>
* The public API entry point is the {@link com.arcticicestudio.nord.Nord} enum.
*
* @author Arctic Ice Studio &lt;development@arcticicestudio.com&gt;
* @see <a href="https://github.com/arcticicestudio/nord-java">Nord - Java </a>
* @see <a href="https://github.com/arcticicestudio/nord">Nord</a>
* @version 0.1.0
* @since 0.1.0
*/
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/com/arcticicestudio/nord/NordTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title Nord API Unit Test +
project nord-java +
version 0.1.0 +
repository https://github.com/arcticicestudio/nord-java +
author Arctic Ice Studio +
email development@arcticicestudio.com +
Expand All @@ -16,15 +15,15 @@ copyright Copyright (C) 2016 +
import static org.junit.Assert.assertEquals;

/**
* Unit tests for the public API {@link Nord}.
* Unit tests for the {@link Nord} public API.
*
* @author Arctic Ice Studio &lt;development@arcticicestudio.com&gt;
* @see Nord
* @since 0.1.0
*/
public class NordTest {

@Test
public void shouldReturnTheCorrectHEXColorCode() {
public void shouldReturnHEXColorCode() {
assertEquals(Nord.hex(Nord.NORD0.get()), "#2E3440");
assertEquals(Nord.hex(Nord.NORD1.get()), "#3B4252");
assertEquals(Nord.hex(Nord.NORD2.get()), "#434C5E");
Expand Down Expand Up @@ -64,7 +63,7 @@ public void shouldReturnTheCorrectRGBColorCode() {
}

@Test
public void shouldReturnTheCorrectVersionString() {
public void shouldReturnValidArcVerVersionString() {
assertEquals(Nord.NORD0.getVersion(), "0.1.0");
}
}

0 comments on commit 9eab580

Please sign in to comment.