Giter Site home page Giter Site logo

ngageoint / color-java Goto Github PK

View Code? Open in Web Editor NEW
13.0 14.0 2.0 348 KB

Color Java Library

Home Page: https://ngageoint.github.io/color-java/

License: MIT License

Java 100.00%
color colors hex hex-color hex-colors hsl hsl-color java nga rgb rgb-color rgb-colors rgba

color-java's Introduction

Color Java

Color Lib

The Color Library was developed at the National Geospatial-Intelligence Agency (NGA) in collaboration with BIT Systems. The government has "unlimited rights" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the MIT license.

Pull Requests

If you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license.

Software source code previously released under an open source license and then modified by NGA staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.

About

Color is a Java library providing color representation with support for hex, RBG, arithmetic RBG, HSL, and integer colors.

Usage

View the latest Javadoc

Color rgb = Color.color(154, 205, 50);
Color rgba = Color.color(255, 165, 0, 64);
Color rgbOpacity = Color.color(255, 165, 0, 0.25f);
Color arithmeticRGB = Color.color(1.0f, 0.64705882352f, 0.0f);
Color arithmeticRGBOpacity = Color.color(1.0f, 0.64705882352f, 0.0f,
    0.25098039215f);
Color hex = Color.color("#BA55D3");
Color hexAlpha = Color.color("#D9FFFF00");
Color hexInteger = Color.color(0xFFC000);
Color hexIntegerAlpha = new Color(0x40FFA500);
Color integer = Color.color(16711680);
Color integerAlpha = Color.color(-12303292);
Color hexSingles = Color.color("FF", "C0", "CB");
Color hexSinglesAlpha = Color.color("00", "00", "00", "80");
Color hexSinglesOpacity = Color.color("FF", "A5", "00", 0.25f);
Color hsl = Color.color(new float[] { 300.0f, 1.0f, 0.2509804f });
Color hsla = Color
    .color(new float[] { 60.0f, 1.0f, 0.5f, 0.85098039215f });
Color orangeAlpha = Color.color(ColorConstants.ORANGE, 120);
Color orangeOpacity = Color.color(ColorConstants.ORANGE, 0.25f);

Color color = Color.blue();
color.setAlpha(56);
String hexValue = color.getColorHex();
String hexShorthand = color.getColorHexShorthand();
String hexWithAlpha = color.getColorHexWithAlpha();
String hexShorthandWithAlpha = color.getColorHexShorthandWithAlpha();
int integerValue = color.getColor();
int integerAlphaValue = color.getColorWithAlpha();
int red = color.getRed();
float greenArithmetic = color.getGreenArithmetic();
String blueHex = color.getBlueHex();
String alphaHexShorthand = color.getAlphaHexShorthand();
float opacity = color.getOpacity();
float[] hslValue = color.getHSL();
float hue = color.getHue();
float saturation = color.getSaturation();
float lightness = color.getLightness();

Installation

Pull from the Maven Central Repository (JAR, POM, Source, Javadoc)

<dependency>
    <groupId>mil.nga</groupId>
    <artifactId>color</artifactId>
    <version>1.0.0</version>
</dependency>

Build

Build & Test

Build this repository using Eclipse and/or Maven:

mvn clean install

color-java's People

Contributors

bosborn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bosborn gbif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.