Documentation ¶
Index ¶
Constants ¶
const ( AnimationCurveFastOutSlowIn = "cubic-bezier(0.4, 0, 0.2, 1)" AnimationCurveLinearOutSlowIn = "cubic-bezier(0, 0, 0.2, 1)" AnimationCurveFastOutLinearIn = "cubic-bezier(0.4, 0, 1, 1)" AnimationCurveDefault = AnimationCurveFastOutSlowIn AugmentedFourth = 1.414 MinorSecond = 1.067 MajorSecond = 1.125 MinorThird = 1.200 MajorThird = 1.250 PerfectFourth = 1.333 PerfectFifth = 1.500 GoldenRatio = 1.618 LuminFlat = 1.015 LuminFat = 1.200 LuminFatThird = 1.245 )
contains different constants used within the package.
Variables ¶
var ( // MaterialPalettes provides material-design chosen color palettes // converted from the material-design spec. MaterialPalettes = map[string][]string{} )
Functions ¶
func GenerateValueScale ¶
func GenerateValueScale(base float64, scale float64, minorCount int, majorCount int) ([]float64, []float64)
GenerateValueScale returns a slice of values which are the a combination of a reducing + increasing scaled values of the provided scale generated from using the base initial 1.0 value against an ever incremental 1.0*(scale * n) or 1.0 / (scale *n) value, where n is the ever increasing index.
Types ¶
type Color ¶
type Color struct { C colorful.Color Hue float64 `json:"hue"` Luminosity float64 `json:"luminosity"` Saturation float64 `json:"saturation"` Alpha float64 `json:"alpha"` }
Color defines a basic struct which expresses the color values provided a struct containing HSL points.
func AdditiveLumination ¶
AdditiveLumination adds the provided scale to the colors Luminouse value returning a new color suited to match.
func AdditiveSaturation ¶
AdditiveSaturation adds the provided scale to the colors saturation value returning a new color suited to match.
func ColorFrom ¶
ColorFrom returns a Color instance representing the valid color values provided else returning error if the color value is not a valid color presentation i.e (rgb,rgba, hsl, hex).
func MultiplicativeLumination ¶
MultiplicativeLumination multiples the scale to the colors Luminouse value using the returned value as addition to the current Luminouse value. Creating a gradual change in luminousity for the returned color.
func MultiplicativeSaturation ¶
MultiplicativeSaturation multiples the scale to the colors saturation value using the returned value as a addition to the current saturation value, Creating a gradual change in saturation for the returned color.
type Tones ¶
Tones defines the set of color tones generated for a base color using the Hamonic tone sets, it provides a very easily set of color variations for use in styles.
func HamonicsFrom ¶
HamonicsFrom uses the above scale to return a slice of new Colors based on the provided HamonyScale set.