utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 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 (
	BASE_COLOR       string  = "#9e2c7b"
	STROKE_COLOR     string  = "#000"
	STROKE_OPACITY   float64 = 0.02
	FILL_COLOR_DARK  string  = "#222"
	FILL_COLOR_LIGHT string  = "#ddd"
	OPACITY_MIN      float64 = 0.02
	OPACITY_MAX      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 Fill_color

func Fill_color(value float64) string

Fill_color returns string to be used for fill color

func Hash

func Hash(s string) string

Hash returns SHA-1 encryption of a string

func Hex_val

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

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

func Map

func Map(value, a_min, a_max, b_min, b_max float64) float64

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

func Merge

func Merge(map_a map[string]interface{}, map_b 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