@vimeo/iris
Version:
Vimeo Design System
23 lines (20 loc) • 624 B
JavaScript
import { readToken } from '../../util/readToken.esm.js';
import { grayscale, slate } from '../../../color/colors.esm.js';
import { clamp } from '../../util/clamp.esm.js';
import { round } from '../../util/round.esm.js';
import 'polished';
var text = function (grade) { return readToken(token, grade); };
var token = {
default: 'light',
type: 'COLOR',
modes: { dark: dark, light: light },
};
function dark(grade) {
return grayscale(clamp(grade / 2.5));
}
function light(grade) {
return slate(clamp(round(grade / -1.667 + 900, 0)));
}
text.primary = text(0);
text.secondary = text(600);
export { text };