diff --git a/.classpath b/.classpath index 148f4f1..9f1f1b2 100644 --- a/.classpath +++ b/.classpath @@ -14,6 +14,6 @@ - + diff --git a/src/network/NetworkTheColorAPI.java b/src/network/NetworkTheColorAPI.java index 5126f53..716a068 100644 --- a/src/network/NetworkTheColorAPI.java +++ b/src/network/NetworkTheColorAPI.java @@ -2,12 +2,15 @@ package network; import com.google.gson.Gson; +import network.NetworkE621.E621ResponseObject; +import utils.HTTPUtils; + // This class is designed to easily query and ask for responses from https://www.thecolorapi.com/. // Unlike some of the other networking classes, the query is much more wrapped. @SuppressWarnings("unused") public class NetworkTheColorAPI { - private static final Gson jsonParser_ = new Gson(); + private static final Gson jsonParser = new Gson(); private class tca_hsv { @@ -35,11 +38,19 @@ public class NetworkTheColorAPI public String clean; // format xxxxxx, with no # } - private class tca_obj + public class ColorData { public tca_hex hex; public tca_rgb rgb; public tca_hsl hsl; public tca_hsv hsv; } + + public ColorData LookupHex() + { + String response = HTTPUtils.SendPOSTRequest("https://www.thecolorapi.com/id?hex=24B1E0"); + + // Use class evaluation on an array of the response imageObject to be able to hold multiple. + ColorData imageObj = jsonParser.fromJson(response, ColorData.class); + } }