// Various ways to generate single random colors

package colorful

// Creates a random dark, "warm" color through a restricted HSV space.
func ( RandInterface) Color {
	return Hsv(
		.Float64()*360.0,
		0.5+.Float64()*0.3,
		0.3+.Float64()*0.3)
}

func () Color {
	return FastWarmColorWithRand(getDefaultGlobalRand())
}

// Creates a random dark, "warm" color through restricted HCL space.
// This is slower than FastWarmColor but will likely give you colors which have
// the same "warmness" if you run it many times.
func ( RandInterface) ( Color) {
	for  = randomWarmWithRand(); !.IsValid();  = randomWarmWithRand() {
	}
	return
}

func () ( Color) {
	return WarmColorWithRand(getDefaultGlobalRand())
}

func randomWarmWithRand( RandInterface) Color {
	return Hcl(
		.Float64()*360.0,
		0.1+.Float64()*0.3,
		0.2+.Float64()*0.3)
}

// Creates a random bright, "pimpy" color through a restricted HSV space.
func ( RandInterface) Color {
	return Hsv(
		.Float64()*360.0,
		0.7+.Float64()*0.3,
		0.6+.Float64()*0.3)
}

func () Color {
	return FastHappyColorWithRand(getDefaultGlobalRand())
}

// Creates a random bright, "pimpy" color through restricted HCL space.
// This is slower than FastHappyColor but will likely give you colors which
// have the same "brightness" if you run it many times.
func ( RandInterface) ( Color) {
	for  = randomPimpWithRand(); !.IsValid();  = randomPimpWithRand() {
	}
	return
}

func () ( Color) {
	return HappyColorWithRand(getDefaultGlobalRand())
}

func randomPimpWithRand( RandInterface) Color {
	return Hcl(
		.Float64()*360.0,
		0.5+.Float64()*0.3,
		0.5+.Float64()*0.3)
}