MCPcopy
hub / github.com/CodeboxIDE/codebox / number

Function number

core/cb.addons/require-tools/less/lessc.js:2384–2395  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

2382}
2383
2384function number(n) {
2385 if (n instanceof tree.Dimension) {
2386 return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);
2387 } else if (typeof(n) === 'number') {
2388 return n;
2389 } else {
2390 throw {
2391 error: "RuntimeError",
2392 message: "color functions take numbers as parameters"
2393 };
2394 }
2395}
2396
2397function clamp(val) {
2398 return Math.min(1, Math.max(0, val));

Callers 2

lessc.jsFile · 0.85
scaledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected