color-classifier
Version:
Classify the color along the reference color. using algorithm the CIEDE2000, RGB, HSV.
20 lines (15 loc) • 299 B
JavaScript
export function radians(n) {
return n * Math.PI / 180;
}
export function degrees(n) {
return n * (180 / Math.PI);
}
export function hypot(a, b) {
return Math.sqrt(a * a + b * b);
}
export function pow2(n) {
return n * n;
}
export function pow7(n) {
return n * n * n * n * n * n * n;
}