mixlea-utils-js 0.1.46 → 0.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -567,6 +567,14 @@ export declare function getFileTypeFromPath(path: string): {
567
567
  mime: string;
568
568
  };
569
569
 
570
+ /**
571
+ * 根据占比调整 HEX 颜色的亮度(通过 HSL)
572
+ * @param hexColor 十六进制颜色(如 "#4CAF50")
573
+ * @param percentage 占比(0~1,0=最亮,1=最暗)
574
+ * @returns 调整后的 HEX 颜色
575
+ */
576
+ export declare function getHexPercentColor(hexColor: string, percentage: number): string;
577
+
570
578
  export declare function getMonthStartTimestamp(value: any, defaultValue: number): number;
571
579
 
572
580
  export declare function getNextMonthDate(value: any, defaultValue?: Date): Date;
@@ -587,14 +595,6 @@ export declare function getOffsetMonthsDate(input: any, months: number, fallback
587
595
 
588
596
  export declare function getOffsetYearsDate(input: any, years: number, fallbackDate?: Date): Date;
589
597
 
590
- /**
591
- * 根据占比调整 HEX 颜色的亮度(通过 HSL)
592
- * @param hexColor 十六进制颜色(如 "#4CAF50")
593
- * @param percentage 占比(0~1,0=最亮,1=最暗)
594
- * @returns 调整后的 HEX 颜色
595
- */
596
- export declare function getPercentHexColor(hexColor: string, percentage: number): string;
597
-
598
598
  export declare function getPercentRGB(rgb: [number, number, number], percentage: number, darken?: boolean): number[];
599
599
 
600
600
  export declare function getPrevMonthDate(value: any, defaultValue?: Date): Date;
@@ -607,6 +607,15 @@ export declare function getRangeDateMonthSegments([startDate, endDate]: [Date, D
607
607
 
608
608
  export declare function getRangeDateYearSegments([startDate, endDate]: [Date, Date]): string[];
609
609
 
610
+ /**
611
+ * 在两个 HEX 颜色之间平滑过渡
612
+ * @param startHex 起始颜色(如 "#FF0000")
613
+ * @param endHex 结束颜色(如 "#00FF00")
614
+ * @param percent 过渡比例(0~1,0=起始色,1=结束色)
615
+ * @returns 过渡后的 HEX 颜色
616
+ */
617
+ export declare function getRangeHexPercentColor(startHex: string, endHex: string, percent: number): string;
618
+
610
619
  export declare function getToday(): Date;
611
620
 
612
621
  export declare function getTodayEndTimestamp(): number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mixlea-utils-js",
3
3
  "type": "module",
4
- "version": "0.1.46",
4
+ "version": "0.1.47",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",
7
7
  "exports": {