colors

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 4 Imported by: 0

README

rovergulf/utils/colors

Go package to generate random colors

package main

import (
	"github.com/rovergulf/utils/colors"
)

func main() {
	var colorInHex string = colors.GetRandomColorInHex()
	var colorInRGB colors.RGBColor = colors.GetRandomColorInRgb()
	var colorInHSV colors.HSVColor = colors.GetRandomColorInHSV()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomColorInHex

func GetRandomColorInHex() string

GetRandomColorInHex returns a random color in HEX format

Types

type HSVColor

type HSVColor struct {
	Hue        float64
	Saturation float64
	Value      float64
}

HSVColor HSV Color Type

func GetRandomColorInHSV

func GetRandomColorInHSV() HSVColor

GetRandomColorInHSV returns a random color in HSV format

type RGBColor

type RGBColor struct {
	Red   int
	Green int
	Blue  int
}

RGBColor RBG Color Type

func GetRandomColorInRgb

func GetRandomColorInRgb() RGBColor

GetRandomColorInRgb Returns a random RGBColor

Jump to

Keyboard shortcuts

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