Code Monkey home page Code Monkey logo

hashicon-net's Introduction

Hashicon-net

Build status codecov Apache 2.0 License FOSSA Status

Hashicon-net is a .NET port of Hashicon. Generates a beautiful representation of any hash.

Usage

Version require

  • .NET Standard 1.3 or higher
  • .NET Framework 4.6 or higher
  • .NET Core 1.0 or higher

Create a hashicon image with default params

using System.IO;
using Hashicon.Params;
using Hashicon;

================================

string hash = "Hex Hash Text";
Param param = new Param();
using (MemoryStream image = Hashicon.GenerateAsStream(hash, param) as MemoryStream) {
	// Stream Process //
}

Custom params are based on the original configuration

using Hashicon.Params;

================================

// These are the default values.
Param TestParam = new Param {
	// size px (HiDPI/Retina aware)
	Size = 100,
	// RenderMode supported Png and Jpg
	RenderMode = Enums.RenderModeEnum.Png,
	// primary color range radius ( 0=red, 60=yellow, 120=green, ..., 360=red )
	Hue = new Hue{
		Max = 360,
		Min = 0
	},
	// saturation ( 0=grey, 100=colorfull )
	Saturation = new Saturation{
		Max = 100,
		Min = 70
	},
	// lightness ( 0=extremlydark, 50=optimal, 100=extremlybright )
	Lightness = new Lightness{
		Max = 65,
		Min = 45
	},
	// hue variation for individual triangles
	Variation = new Variation{
		Max = 20,
		Min = 5,
		Enabled = true
	},
	// color shift from primary hue to secondary hue ( the pattern )
	Shift = new Shift{
		Max = 300,
		Min = 60
	},
	// the pattern opacity
	FigureAlpha = new FigureAlpha{
		Max = 1.0,
		Min = 0.7
	},
	// simulate a 3d cube by different areas gets some more/less light applyed
	Light = new Light{
		Top = 10,
		Right = -8,
		Left = -4,
		Enabled = true,
	}
};

There is also method to save in Base64

string Base64Text = Hashicon.GenerateAsBase64(Hash, Param);

License

Hashicon-net is licensed under the Apache License 2.0. Please see the licence file for more information.

-> https://github.com/Fairy-Phy/Hashicon-net/blob/master/LICENSE

FOSSA Status

hashicon-net's People

Contributors

slofp avatar

Watchers

 avatar  avatar

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.