utils

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package utils provide utility functions that helps development across the project.

Index

Constants

View Source
const (
	BaseColor      string  = "#9e2c7b"
	StrokeColor    string  = "#000"
	StrokeOpacity  float64 = 0.02
	FillColorDark  string  = "#222"
	FillColorLight string  = "#ddd"
	OpacityMin     float64 = 0.02
	OpacityMax     float64 = 0.15
)

constants representing stroke, fill's opacity and color, base color, minimum and maximum opacity value

Variables

This section is empty.

Functions

func FillColor added in v1.4.0

func FillColor(value float64) string

FillColor returns string to be used for fill color

func Hash

func Hash(s string) string

Hash returns SHA-1 encryption of a string

func HexVal added in v1.4.0

func HexVal(str string, index, length int) float64

HexVal returns decimal representation of a substring of a hexa decimal string

func Map

func Map(value, aMin, aMax, bMin, bMax float64) float64

Map returns respective value of a number from a range to different range

func Merge

func Merge(mapA map[string]interface{}, mapB map[string]interface{}) map[string]interface{}

Merge merges two 'map' objects and returns the resultant object

func Opacity

func Opacity(value float64) float64

Opacity returns opacity value in a particular range

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL