MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / encodeUnderlineStyle

Function encodeUnderlineStyle

packages/core/src/drawlist/builder.ts:109–124  ·  view source on GitHub ↗
(style: TextStyle["underlineStyle"] | undefined)

Source from the content-addressed store, hash-verified

107});
108
109function encodeUnderlineStyle(style: TextStyle["underlineStyle"] | undefined): number {
110 switch (style) {
111 case "straight":
112 return 1;
113 case "double":
114 return 2;
115 case "curly":
116 return 3;
117 case "dotted":
118 return 4;
119 case "dashed":
120 return 5;
121 default:
122 return 0;
123 }
124}
125
126function asPackedRgb24(value: unknown): number {
127 if (typeof value !== "number" || !Number.isFinite(value)) return 0;

Callers 1

encodeStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected