You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
599 B
30 lines
599 B
3 years ago
|
// Colorful FX - Unity Asset
|
||
|
// Copyright (c) 2015 - Thomas Hourdel
|
||
|
// http://www.thomashourdel.com
|
||
|
|
||
|
namespace Colorful
|
||
|
{
|
||
|
using UnityEngine;
|
||
|
|
||
|
public static class CLib
|
||
|
{
|
||
|
public const float PI_2 = Mathf.PI / 2f;
|
||
|
public const float PI2 = Mathf.PI * 2f;
|
||
|
|
||
|
public static float Frac(float f)
|
||
|
{
|
||
|
return f - Mathf.Floor(f);
|
||
|
}
|
||
|
|
||
|
public static bool IsLinearColorSpace()
|
||
|
{
|
||
|
return QualitySettings.activeColorSpace == ColorSpace.Linear;
|
||
|
}
|
||
|
|
||
|
public static bool Approximately(float source, float about, float range = 0.0001f)
|
||
|
{
|
||
|
return ((Mathf.Abs(source - about) < range));
|
||
|
}
|
||
|
}
|
||
|
}
|