MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / parseColorStop

Function parseColorStop

packages/core/css/parser.ts:489–507  ·  view source on GitHub ↗
(text: string, start = 0)

Source from the content-addressed store, hash-verified

487}
488
489export function parseColorStop(text: string, start = 0): Parsed<ColorStop> {
490 const color = parseColor(text, start);
491 if (!color) {
492 return null;
493 }
494 let end = color.end;
495 const offset = parsePercentageOrLength(text, end);
496 if (offset) {
497 end = offset.end;
498
499 return {
500 start,
501 end,
502 value: { color: color.value, offset: offset.value },
503 };
504 }
505
506 return { start, end, value: { color: color.value } };
507}
508
509const linearGradientStartRegEx = /\s*linear-gradient\s*/gy;
510export function parseLinearGradient(text: string, start = 0): Parsed<LinearGradient> {

Callers 1

parseLinearGradientFunction · 0.85

Calls 2

parseColorFunction · 0.85
parsePercentageOrLengthFunction · 0.85

Tested by

no test coverage detected