@ued_fpi/data-visual 1.1.0 → 1.1.1

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.
Files changed (357) hide show
  1. package/dist/es/aims/service/request.mjs +1 -1
  2. package/dist/es/aims/src/AirQualityCalendar/index.mjs +12 -7
  3. package/dist/es/aims/src/AirQualityLevelMonthRatio/index.mjs +5 -5
  4. package/dist/es/aims/src/AirQualityLevelYearRatio/index.mjs +3 -3
  5. package/dist/es/aims/src/AirQualityPresentSituation/index.mjs +10 -13
  6. package/dist/es/aims/src/AirQualityRealTime/index.mjs +13 -16
  7. package/dist/es/aims/src/AirTimeSeriesAnalysis/index.mjs +1 -1
  8. package/dist/es/aims/src/CieqContributionMonthRatio/index.mjs +3 -3
  9. package/dist/es/aims/src/CieqContributionYearRatio/index.mjs +5 -5
  10. package/dist/es/aims/src/FactorRealTimeRankChart/index.mjs +6 -7
  11. package/dist/es/aims/src/FactorRealTimeRankList/index.mjs +7 -7
  12. package/dist/es/aims/src/FactorTargetYearPeriod/index.mjs +3 -3
  13. package/dist/es/aims/src/MainPollutionMonthRatio/index.mjs +3 -3
  14. package/dist/es/aims/src/MainPollutionYearRatio/index.mjs +3 -3
  15. package/dist/es/aims/src/MulGridAirQualityLevelMonthRatio/index.mjs +3 -3
  16. package/dist/es/aims/src/MulGridCieqContributionMonthRatio/index.mjs +3 -3
  17. package/dist/es/aims/src/TbHbAnalysis/index.mjs +4 -4
  18. package/dist/es/aims/src/WeatherCondition/index.mjs +5 -5
  19. package/dist/es/aims/src/common/BasicDialog/index.mjs +3 -3
  20. package/dist/es/aims/src/common/BasicEcharts/index.mjs +2 -2
  21. package/dist/es/aims/src/common/BasicPanel/index.mjs +3 -1
  22. package/dist/es/aims/utils/tools.mjs +1 -1
  23. package/dist/es/bmp/config/index.mjs +7 -0
  24. package/dist/es/bmp/service/base-serve.d.ts +4 -0
  25. package/dist/es/bmp/service/base-serve.mjs +12 -0
  26. package/dist/es/bmp/service/request.d.ts +3 -0
  27. package/dist/es/bmp/service/request.mjs +78 -0
  28. package/dist/es/bmp/service/types.d.ts +14 -0
  29. package/dist/es/bmp/src/AlgaeMonitoring/api/index.d.ts +6 -0
  30. package/dist/es/bmp/src/AlgaeMonitoring/api/index.mjs +12 -0
  31. package/dist/es/bmp/src/AlgaeMonitoring/api/types.d.ts +21 -0
  32. package/dist/es/bmp/src/AlgaeMonitoring/images/checked.mjs +3 -0
  33. package/dist/es/bmp/src/AlgaeMonitoring/images/today-alarm.mjs +3 -0
  34. package/dist/es/bmp/src/AlgaeMonitoring/index.d.ts +97 -0
  35. package/dist/es/bmp/src/AlgaeMonitoring/index.mjs +193 -0
  36. package/dist/es/bmp/src/AlgaeMonitoring/index.vue.d.ts +6 -0
  37. package/dist/es/bmp/src/index.d.ts +1 -1
  38. package/dist/es/bmp/src/index.mjs +2 -2
  39. package/dist/es/index.mjs +58 -20
  40. package/dist/es/ipes/service/request.mjs +2 -1
  41. package/dist/es/ipes/src/AccessVehicleManage/index.d.ts +81 -7
  42. package/dist/es/ipes/src/AccessVehicleManage/index.mjs +103 -40
  43. package/dist/es/ipes/src/AccessVehicleManage/index.vue.d.ts +48 -3
  44. package/dist/es/ipes/src/AirPollutionDischarge/images/new-nodata.mjs +3 -0
  45. package/dist/es/ipes/src/AirPollutionDischarge/index.d.ts +3 -107
  46. package/dist/es/ipes/src/AirPollutionDischarge/index.mjs +184 -127
  47. package/dist/es/ipes/src/AirPollutionDischarge/index.vue.d.ts +1 -64
  48. package/dist/es/ipes/src/AirQuality/index.mjs +25 -16
  49. package/dist/es/ipes/src/AirQualityManagement/index.mjs +31 -20
  50. package/dist/es/ipes/src/AlarmManage/images/alarm.mjs +3 -0
  51. package/dist/es/ipes/src/AlarmManage/images/modeluIcon.mjs +3 -0
  52. package/dist/es/ipes/src/AlarmManage/images/new-nodata.mjs +3 -0
  53. package/dist/es/ipes/src/AlarmManage/index.d.ts +89 -0
  54. package/dist/es/ipes/src/AlarmManage/index.mjs +175 -0
  55. package/dist/es/ipes/src/AlarmManage/index.vue.d.ts +2 -0
  56. package/dist/es/ipes/src/AlarmManage/type.d.ts +5 -0
  57. package/dist/es/ipes/src/BusinessManage/images/icon-percent.mjs +3 -0
  58. package/dist/es/ipes/src/BusinessManage/index.d.ts +89 -0
  59. package/dist/es/ipes/src/BusinessManage/index.mjs +196 -0
  60. package/dist/es/ipes/src/BusinessManage/index.vue.d.ts +2 -0
  61. package/dist/es/ipes/src/BusinessManage/type.d.ts +10 -0
  62. package/dist/es/ipes/src/EmergencyDuty/index.mjs +3 -3
  63. package/dist/es/ipes/src/EnterpriseProtectionCode/index.d.ts +38 -3
  64. package/dist/es/ipes/src/EnterpriseProtectionCode/index.mjs +52 -30
  65. package/dist/es/ipes/src/EnterpriseProtectionCode/index.vue.d.ts +22 -1
  66. package/dist/es/ipes/src/EnvManage/index.mjs +17 -14
  67. package/dist/es/ipes/src/EnvironmentalProtection/images/module-title-icon.mjs +3 -0
  68. package/dist/es/ipes/src/EnvironmentalProtection/images/piebottom.mjs +3 -0
  69. package/dist/es/ipes/src/EnvironmentalProtection/images/pietop.mjs +3 -0
  70. package/dist/es/ipes/src/EnvironmentalProtection/index.d.ts +101 -0
  71. package/dist/es/ipes/src/EnvironmentalProtection/index.mjs +177 -0
  72. package/dist/es/ipes/src/EnvironmentalProtection/index.vue.d.ts +6 -0
  73. package/dist/es/ipes/src/EnvironmentalRiskManagement/.mjs +2 -2
  74. package/dist/es/ipes/src/EnvironmentalRiskManagement/index.d.ts +23 -3
  75. package/dist/es/ipes/src/EnvironmentalRiskManagement/index.mjs +48 -12
  76. package/dist/es/ipes/src/EnvironmentalRiskManagement/index.vue.d.ts +13 -1
  77. package/dist/es/ipes/src/GasControl/.mjs +120 -0
  78. package/dist/es/ipes/src/GasControl/components/AlarmStatistics.vue.d.ts +22 -0
  79. package/dist/es/ipes/src/GasControl/components/SingleItem.vue.d.ts +16 -0
  80. package/dist/es/{bmp/src/test-com → ipes/src/GasControl}/index.d.ts +28 -24
  81. package/dist/es/ipes/src/GasControl/index.mjs +103 -0
  82. package/dist/es/ipes/src/GasControl/index.vue.d.ts +23 -0
  83. package/dist/es/ipes/src/GeneralManagement/.mjs +14 -17
  84. package/dist/es/ipes/src/GeneralManagement/components/Tabs.vue.d.ts +10 -6
  85. package/dist/es/ipes/src/GeneralManagement/index.d.ts +18 -9
  86. package/dist/es/ipes/src/GeneralManagement/index.mjs +9 -11
  87. package/dist/es/ipes/src/GeneralManagement/index.vue.d.ts +12 -6
  88. package/dist/es/ipes/src/HazardousVehicleManage/index.d.ts +82 -14
  89. package/dist/es/ipes/src/HazardousVehicleManage/index.mjs +67 -42
  90. package/dist/es/ipes/src/HazardousVehicleManage/index.vue.d.ts +48 -5
  91. package/dist/es/ipes/src/InspectionManage/images/module-title-icon.mjs +3 -0
  92. package/dist/es/ipes/src/InspectionManage/images/new-nodata.mjs +3 -0
  93. package/dist/es/ipes/src/InspectionManage/index.d.ts +136 -0
  94. package/dist/es/ipes/src/InspectionManage/index.mjs +267 -0
  95. package/dist/es/ipes/src/InspectionManage/index.vue.d.ts +27 -0
  96. package/dist/es/ipes/src/InspectionManage/types/index.d.ts +11 -0
  97. package/dist/es/ipes/src/Level3AirDefense/.mjs +38 -12
  98. package/dist/es/ipes/src/Level3AirDefense/components/EmptyData.vue.d.ts +14 -0
  99. package/dist/es/ipes/src/Level3AirDefense/images/empty.mjs +3 -0
  100. package/dist/es/ipes/src/Level3AirDefense/index.mjs +10 -9
  101. package/dist/es/ipes/src/OdorControl/index.mjs +1 -1
  102. package/dist/es/ipes/src/PollutantSourceManage/index.d.ts +168 -0
  103. package/dist/es/ipes/src/PollutantSourceManage/index.mjs +90 -0
  104. package/dist/es/ipes/src/PollutantSourceManage/index.vue.d.ts +42 -0
  105. package/dist/es/ipes/src/PollutantSourceManage/types.d.ts +18 -0
  106. package/dist/es/ipes/src/RealTimeAirQualityManage/index.mjs +1 -1
  107. package/dist/es/ipes/src/SealingManage/index.d.ts +121 -14
  108. package/dist/es/ipes/src/SealingManage/index.mjs +221 -83
  109. package/dist/es/ipes/src/SealingManage/index.vue.d.ts +72 -5
  110. package/dist/es/ipes/src/TaskDispose/.mjs +2 -2
  111. package/dist/es/ipes/src/VocStatistics/index.mjs +2 -2
  112. package/dist/es/ipes/src/WaterNetworkManage/index.d.ts +81 -7
  113. package/dist/es/ipes/src/WaterNetworkManage/index.mjs +71 -39
  114. package/dist/es/ipes/src/WaterNetworkManage/index.vue.d.ts +48 -3
  115. package/dist/es/ipes/src/common/Echarts.mjs +2 -2
  116. package/dist/es/ipes/src/common/IpesPercentBar.mjs +38 -0
  117. package/dist/es/ipes/src/common/IpesProgressBar.mjs +38 -0
  118. package/dist/es/ipes/src/common/LottieAnimation.mjs +3 -3
  119. package/dist/es/ipes/src/index.d.ts +6 -0
  120. package/dist/es/ipes/src/index.mjs +12 -0
  121. package/dist/es/style.css +1514 -909
  122. package/dist/es/wgms/service/request.mjs +1 -1
  123. package/dist/es/wgms/src/AuxiliaryJudgment/index.mjs +3 -3
  124. package/dist/es/wgms/src/ChangesAlongTheProcess/index.mjs +3 -3
  125. package/dist/es/wgms/src/ChlorophyllAchangeRate/index.mjs +5 -5
  126. package/dist/es/wgms/src/CrossSectionCorrelation/index.mjs +4 -4
  127. package/dist/es/wgms/src/DistributionPoints/index.mjs +4 -4
  128. package/dist/es/wgms/src/DrinkingWaterComplianceRate/index.mjs +2 -2
  129. package/dist/es/wgms/src/EnvironmentalAnalysis/index.mjs +7 -5
  130. package/dist/es/wgms/src/FactorTopThreeRanking/index.mjs +4 -4
  131. package/dist/es/wgms/src/FactorTrendComparison/index.mjs +2 -2
  132. package/dist/es/wgms/src/KeyRiverWaterQualityEvaluation/index.mjs +3 -3
  133. package/dist/es/wgms/src/LakeRiverIndex/index.mjs +4 -4
  134. package/dist/es/wgms/src/NPTrendChange/index.mjs +2 -2
  135. package/dist/es/wgms/src/SevenDayKline/index.mjs +4 -4
  136. package/dist/es/wgms/src/SewageOutletsOnlineMonitor/index.mjs +4 -4
  137. package/dist/es/wgms/src/SewageOutletsOnlineMonitor/index.vue.d.ts +0 -1
  138. package/dist/es/wgms/src/SubordinateRanking/index.mjs +7 -4
  139. package/dist/es/wgms/src/SurroundingPollution/index.mjs +5 -5
  140. package/dist/es/wgms/src/UpstreamImpact/index.mjs +3 -3
  141. package/dist/es/wgms/src/UpstreamSection/index.mjs +3 -3
  142. package/dist/es/wgms/src/WaterEnvironmentOnlineMonitor/index.mjs +2 -2
  143. package/dist/es/wgms/src/WaterQualityClassification/index.mjs +3 -3
  144. package/dist/es/wgms/src/WaterQualityRainfall/index.mjs +3 -3
  145. package/dist/es/wgms/src/WaterQualityStatus/index.mjs +3 -3
  146. package/dist/es/wgms/src/common/select-panel.mjs +3 -1
  147. package/dist/es/wgms/utils/echarts/index.mjs +14 -2
  148. package/dist/es/wgms/utils/tools.mjs +1 -1
  149. package/dist/lib/aims/service/request.js +3 -3
  150. package/dist/lib/aims/src/AirQualityCalendar/index.js +20 -15
  151. package/dist/lib/aims/src/AirQualityLevelMonthRatio/index.js +6 -6
  152. package/dist/lib/aims/src/AirQualityLevelYearRatio/index.js +4 -4
  153. package/dist/lib/aims/src/AirQualityPresentSituation/index.js +9 -12
  154. package/dist/lib/aims/src/AirQualityRealTime/index.js +12 -15
  155. package/dist/lib/aims/src/AirTimeSeriesAnalysis/index.js +5 -5
  156. package/dist/lib/aims/src/CieqContributionMonthRatio/index.js +4 -4
  157. package/dist/lib/aims/src/CieqContributionYearRatio/index.js +6 -6
  158. package/dist/lib/aims/src/FactorRealTimeRankChart/index.js +7 -8
  159. package/dist/lib/aims/src/FactorRealTimeRankList/index.js +8 -8
  160. package/dist/lib/aims/src/FactorTargetYearPeriod/index.js +4 -4
  161. package/dist/lib/aims/src/MainPollutionMonthRatio/index.js +4 -4
  162. package/dist/lib/aims/src/MainPollutionYearRatio/index.js +4 -4
  163. package/dist/lib/aims/src/MulGridAirQualityLevelMonthRatio/index.js +4 -4
  164. package/dist/lib/aims/src/MulGridCieqContributionMonthRatio/index.js +4 -4
  165. package/dist/lib/aims/src/TbHbAnalysis/index.js +6 -6
  166. package/dist/lib/aims/src/WeatherCondition/index.js +5 -5
  167. package/dist/lib/aims/src/common/BasicDialog/index.js +3 -3
  168. package/dist/lib/aims/src/common/BasicEcharts/index.js +21 -2
  169. package/dist/lib/aims/src/common/BasicPanel/index.js +4 -2
  170. package/dist/lib/aims/utils/tools.js +2 -2
  171. package/dist/lib/bmp/config/index.js +8 -0
  172. package/dist/lib/bmp/service/base-serve.d.ts +4 -0
  173. package/dist/lib/bmp/service/base-serve.js +14 -0
  174. package/dist/lib/bmp/service/request.d.ts +3 -0
  175. package/dist/lib/bmp/service/request.js +80 -0
  176. package/dist/lib/bmp/service/types.d.ts +14 -0
  177. package/dist/lib/bmp/src/AlgaeMonitoring/api/index.d.ts +6 -0
  178. package/dist/lib/bmp/src/AlgaeMonitoring/api/index.js +14 -0
  179. package/dist/lib/bmp/src/AlgaeMonitoring/api/types.d.ts +21 -0
  180. package/dist/lib/bmp/src/AlgaeMonitoring/images/checked.js +5 -0
  181. package/dist/lib/bmp/src/AlgaeMonitoring/images/today-alarm.js +5 -0
  182. package/dist/lib/bmp/src/AlgaeMonitoring/index.d.ts +97 -0
  183. package/dist/lib/bmp/src/AlgaeMonitoring/index.js +214 -0
  184. package/dist/lib/bmp/src/AlgaeMonitoring/index.vue.d.ts +6 -0
  185. package/dist/lib/bmp/src/index.d.ts +1 -1
  186. package/dist/lib/bmp/src/index.js +2 -2
  187. package/dist/lib/index.js +65 -21
  188. package/dist/lib/ipes/service/request.js +4 -3
  189. package/dist/lib/ipes/src/AccessVehicleManage/index.d.ts +81 -7
  190. package/dist/lib/ipes/src/AccessVehicleManage/index.js +107 -44
  191. package/dist/lib/ipes/src/AccessVehicleManage/index.vue.d.ts +48 -3
  192. package/dist/lib/ipes/src/AirPollutionDischarge/images/new-nodata.js +5 -0
  193. package/dist/lib/ipes/src/AirPollutionDischarge/index.d.ts +3 -107
  194. package/dist/lib/ipes/src/AirPollutionDischarge/index.js +183 -126
  195. package/dist/lib/ipes/src/AirPollutionDischarge/index.vue.d.ts +1 -64
  196. package/dist/lib/ipes/src/AirQuality/index.js +25 -16
  197. package/dist/lib/ipes/src/AirQualityManagement/index.js +31 -20
  198. package/dist/lib/ipes/src/AlarmManage/images/alarm.js +5 -0
  199. package/dist/lib/ipes/src/AlarmManage/images/modeluIcon.js +5 -0
  200. package/dist/lib/ipes/src/AlarmManage/images/new-nodata.js +5 -0
  201. package/dist/lib/ipes/src/AlarmManage/index.d.ts +89 -0
  202. package/dist/lib/ipes/src/AlarmManage/index.js +177 -0
  203. package/dist/lib/ipes/src/AlarmManage/index.vue.d.ts +2 -0
  204. package/dist/lib/ipes/src/AlarmManage/type.d.ts +5 -0
  205. package/dist/lib/ipes/src/BusinessManage/images/icon-percent.js +5 -0
  206. package/dist/lib/ipes/src/BusinessManage/index.d.ts +89 -0
  207. package/dist/lib/ipes/src/BusinessManage/index.js +198 -0
  208. package/dist/lib/ipes/src/BusinessManage/index.vue.d.ts +2 -0
  209. package/dist/lib/ipes/src/BusinessManage/type.d.ts +10 -0
  210. package/dist/lib/ipes/src/EmergencyDuty/index.js +3 -3
  211. package/dist/lib/ipes/src/EnterpriseProtectionCode/index.d.ts +38 -3
  212. package/dist/lib/ipes/src/EnterpriseProtectionCode/index.js +52 -30
  213. package/dist/lib/ipes/src/EnterpriseProtectionCode/index.vue.d.ts +22 -1
  214. package/dist/lib/ipes/src/EnvManage/index.js +19 -16
  215. package/dist/lib/ipes/src/EnvironmentalProtection/images/module-title-icon.js +5 -0
  216. package/dist/lib/ipes/src/EnvironmentalProtection/images/piebottom.js +5 -0
  217. package/dist/lib/ipes/src/EnvironmentalProtection/images/pietop.js +5 -0
  218. package/dist/lib/ipes/src/EnvironmentalProtection/index.d.ts +101 -0
  219. package/dist/lib/ipes/src/EnvironmentalProtection/index.js +179 -0
  220. package/dist/lib/ipes/src/EnvironmentalProtection/index.vue.d.ts +6 -0
  221. package/dist/lib/ipes/src/EnvironmentalRiskManagement/.js +2 -2
  222. package/dist/lib/ipes/src/EnvironmentalRiskManagement/index.d.ts +23 -3
  223. package/dist/lib/ipes/src/EnvironmentalRiskManagement/index.js +47 -11
  224. package/dist/lib/ipes/src/EnvironmentalRiskManagement/index.vue.d.ts +13 -1
  225. package/dist/lib/ipes/src/GasControl/.js +123 -0
  226. package/dist/lib/ipes/src/GasControl/components/AlarmStatistics.vue.d.ts +22 -0
  227. package/dist/lib/ipes/src/GasControl/components/SingleItem.vue.d.ts +16 -0
  228. package/dist/lib/{bmp/src/test-com → ipes/src/GasControl}/index.d.ts +28 -24
  229. package/dist/lib/ipes/src/GasControl/index.js +105 -0
  230. package/dist/lib/ipes/src/GasControl/index.vue.d.ts +23 -0
  231. package/dist/lib/ipes/src/GeneralManagement/.js +13 -16
  232. package/dist/lib/ipes/src/GeneralManagement/components/Tabs.vue.d.ts +10 -6
  233. package/dist/lib/ipes/src/GeneralManagement/index.d.ts +18 -9
  234. package/dist/lib/ipes/src/GeneralManagement/index.js +8 -10
  235. package/dist/lib/ipes/src/GeneralManagement/index.vue.d.ts +12 -6
  236. package/dist/lib/ipes/src/HazardousVehicleManage/index.d.ts +82 -14
  237. package/dist/lib/ipes/src/HazardousVehicleManage/index.js +74 -49
  238. package/dist/lib/ipes/src/HazardousVehicleManage/index.vue.d.ts +48 -5
  239. package/dist/lib/ipes/src/InspectionManage/images/module-title-icon.js +5 -0
  240. package/dist/lib/ipes/src/InspectionManage/images/new-nodata.js +5 -0
  241. package/dist/lib/ipes/src/InspectionManage/index.d.ts +136 -0
  242. package/dist/lib/ipes/src/InspectionManage/index.js +269 -0
  243. package/dist/lib/ipes/src/InspectionManage/index.vue.d.ts +27 -0
  244. package/dist/lib/ipes/src/InspectionManage/types/index.d.ts +11 -0
  245. package/dist/lib/ipes/src/Level3AirDefense/.js +37 -10
  246. package/dist/lib/ipes/src/Level3AirDefense/components/EmptyData.vue.d.ts +14 -0
  247. package/dist/lib/ipes/src/Level3AirDefense/images/empty.js +5 -0
  248. package/dist/lib/ipes/src/Level3AirDefense/index.js +9 -8
  249. package/dist/lib/ipes/src/OdorControl/index.js +2 -2
  250. package/dist/lib/ipes/src/PollutantSourceManage/index.d.ts +168 -0
  251. package/dist/lib/ipes/src/PollutantSourceManage/index.js +92 -0
  252. package/dist/lib/ipes/src/PollutantSourceManage/index.vue.d.ts +42 -0
  253. package/dist/lib/ipes/src/PollutantSourceManage/types.d.ts +18 -0
  254. package/dist/lib/ipes/src/RealTimeAirQualityManage/index.js +2 -2
  255. package/dist/lib/ipes/src/SealingManage/index.d.ts +121 -14
  256. package/dist/lib/ipes/src/SealingManage/index.js +222 -84
  257. package/dist/lib/ipes/src/SealingManage/index.vue.d.ts +72 -5
  258. package/dist/lib/ipes/src/TaskDispose/.js +21 -2
  259. package/dist/lib/ipes/src/VocStatistics/index.js +2 -2
  260. package/dist/lib/ipes/src/WaterNetworkManage/index.d.ts +81 -7
  261. package/dist/lib/ipes/src/WaterNetworkManage/index.js +73 -41
  262. package/dist/lib/ipes/src/WaterNetworkManage/index.vue.d.ts +48 -3
  263. package/dist/lib/ipes/src/common/Echarts.js +21 -2
  264. package/dist/lib/ipes/src/common/IpesPercentBar.js +40 -0
  265. package/dist/lib/ipes/src/common/IpesProgressBar.js +40 -0
  266. package/dist/lib/ipes/src/common/LottieAnimation.js +2 -2
  267. package/dist/lib/ipes/src/index.d.ts +6 -0
  268. package/dist/lib/ipes/src/index.js +12 -0
  269. package/dist/lib/style.css +1514 -909
  270. package/dist/lib/wgms/service/request.js +3 -3
  271. package/dist/lib/wgms/src/AuxiliaryJudgment/index.js +5 -5
  272. package/dist/lib/wgms/src/ChangesAlongTheProcess/index.js +4 -4
  273. package/dist/lib/wgms/src/ChlorophyllAchangeRate/index.js +4 -4
  274. package/dist/lib/wgms/src/CrossSectionCorrelation/index.js +6 -6
  275. package/dist/lib/wgms/src/DistributionPoints/index.js +3 -3
  276. package/dist/lib/wgms/src/DrinkingWaterComplianceRate/index.js +2 -2
  277. package/dist/lib/wgms/src/EnvironmentalAnalysis/index.js +10 -8
  278. package/dist/lib/wgms/src/FactorTopThreeRanking/index.js +3 -3
  279. package/dist/lib/wgms/src/FactorTrendComparison/index.js +2 -2
  280. package/dist/lib/wgms/src/KeyRiverWaterQualityEvaluation/index.js +3 -3
  281. package/dist/lib/wgms/src/LakeRiverIndex/index.js +6 -6
  282. package/dist/lib/wgms/src/NPTrendChange/index.js +2 -2
  283. package/dist/lib/wgms/src/SevenDayKline/index.js +9 -9
  284. package/dist/lib/wgms/src/SewageOutletsOnlineMonitor/index.js +4 -4
  285. package/dist/lib/wgms/src/SewageOutletsOnlineMonitor/index.vue.d.ts +0 -1
  286. package/dist/lib/wgms/src/SubordinateRanking/index.js +12 -9
  287. package/dist/lib/wgms/src/SurroundingPollution/index.js +8 -8
  288. package/dist/lib/wgms/src/UpstreamImpact/index.js +4 -4
  289. package/dist/lib/wgms/src/UpstreamSection/index.js +3 -3
  290. package/dist/lib/wgms/src/WaterEnvironmentOnlineMonitor/index.js +2 -2
  291. package/dist/lib/wgms/src/WaterQualityClassification/index.js +3 -3
  292. package/dist/lib/wgms/src/WaterQualityRainfall/index.js +5 -5
  293. package/dist/lib/wgms/src/WaterQualityStatus/index.js +3 -3
  294. package/dist/lib/wgms/src/common/select-panel.js +4 -2
  295. package/dist/lib/wgms/utils/echarts/index.js +34 -3
  296. package/dist/lib/wgms/utils/tools.js +2 -2
  297. package/package.json +2 -2
  298. package/dist/es/bmp/src/test-com/index.mjs +0 -33
  299. package/dist/es/bmp/src/test-com/index.vue.d.ts +0 -23
  300. package/dist/es/bmp/src/test-com/types.d.ts +0 -16
  301. package/dist/es/vendor/@ctrl_tinycolor@3.6.0.mjs +0 -1136
  302. package/dist/es/vendor/@element-plus_icons-vue@2.0.10_vue@3.3.4.mjs +0 -376
  303. package/dist/es/vendor/@floating-ui_core@1.3.1.mjs +0 -1
  304. package/dist/es/vendor/@floating-ui_dom@1.4.4.mjs +0 -1
  305. package/dist/es/vendor/@sxzz_popperjs-es@2.11.7.mjs +0 -3
  306. package/dist/es/vendor/@ued_fpi_element-plus-expand@0.7.19.mjs +0 -243
  307. package/dist/es/vendor/@vue_reactivity@3.3.4.mjs +0 -1
  308. package/dist/es/vendor/@vue_shared@3.3.4.mjs +0 -29
  309. package/dist/es/vendor/@vueuse_core@9.13.0_vue@3.3.4.mjs +0 -214
  310. package/dist/es/vendor/@vueuse_shared@9.13.0_vue@3.3.4.mjs +0 -72
  311. package/dist/es/vendor/async-validator@4.2.5.mjs +0 -1
  312. package/dist/es/vendor/axios@1.4.0.mjs +0 -3209
  313. package/dist/es/vendor/claygl@1.3.0.mjs +0 -24199
  314. package/dist/es/vendor/dayjs@1.11.9.mjs +0 -88
  315. package/dist/es/vendor/echarts-gl@2.0.9_echarts@5.4.2.mjs +0 -20973
  316. package/dist/es/vendor/echarts@5.4.2.mjs +0 -79359
  317. package/dist/es/vendor/element-plus@2.3.7_vue@3.3.4.mjs +0 -11032
  318. package/dist/es/vendor/escape-html@1.0.3.mjs +0 -1
  319. package/dist/es/vendor/fpi-tg-factor-tools@1.0.4.mjs +0 -195
  320. package/dist/es/vendor/lodash-es@4.17.21.mjs +0 -3255
  321. package/dist/es/vendor/lodash-unified@1.0.3_tknf7errc3xdqocd3ryzzla7vq.mjs +0 -1
  322. package/dist/es/vendor/memoize-one@6.0.0.mjs +0 -1
  323. package/dist/es/vendor/normalize-wheel-es@1.2.0.mjs +0 -1
  324. package/dist/es/vendor/tslib@2.3.0.mjs +0 -32
  325. package/dist/es/vendor/vue-demi@0.14.5_vue@3.3.4.mjs +0 -1
  326. package/dist/es/vendor/vue3-seamless-scroll@2.0.1.mjs +0 -562
  327. package/dist/es/vendor/zrender@5.4.3.mjs +0 -16894
  328. package/dist/lib/bmp/src/test-com/index.js +0 -35
  329. package/dist/lib/bmp/src/test-com/index.vue.d.ts +0 -23
  330. package/dist/lib/bmp/src/test-com/types.d.ts +0 -16
  331. package/dist/lib/vendor/@ctrl_tinycolor@3.6.0.js +0 -1138
  332. package/dist/lib/vendor/@element-plus_icons-vue@2.0.10_vue@3.3.4.js +0 -396
  333. package/dist/lib/vendor/@floating-ui_core@1.3.1.js +0 -2
  334. package/dist/lib/vendor/@floating-ui_dom@1.4.4.js +0 -2
  335. package/dist/lib/vendor/@sxzz_popperjs-es@2.11.7.js +0 -6
  336. package/dist/lib/vendor/@ued_fpi_element-plus-expand@0.7.19.js +0 -245
  337. package/dist/lib/vendor/@vue_reactivity@3.3.4.js +0 -2
  338. package/dist/lib/vendor/@vue_shared@3.3.4.js +0 -39
  339. package/dist/lib/vendor/@vueuse_core@9.13.0_vue@3.3.4.js +0 -219
  340. package/dist/lib/vendor/@vueuse_shared@9.13.0_vue@3.3.4.js +0 -82
  341. package/dist/lib/vendor/async-validator@4.2.5.js +0 -2
  342. package/dist/lib/vendor/axios@1.4.0.js +0 -3211
  343. package/dist/lib/vendor/claygl@1.3.0.js +0 -24255
  344. package/dist/lib/vendor/dayjs@1.11.9.js +0 -98
  345. package/dist/lib/vendor/echarts-gl@2.0.9_echarts@5.4.2.js +0 -20975
  346. package/dist/lib/vendor/echarts@5.4.2.js +0 -79400
  347. package/dist/lib/vendor/element-plus@2.3.7_vue@3.3.4.js +0 -11041
  348. package/dist/lib/vendor/escape-html@1.0.3.js +0 -2
  349. package/dist/lib/vendor/fpi-tg-factor-tools@1.0.4.js +0 -201
  350. package/dist/lib/vendor/lodash-es@4.17.21.js +0 -3265
  351. package/dist/lib/vendor/lodash-unified@1.0.3_tknf7errc3xdqocd3ryzzla7vq.js +0 -2
  352. package/dist/lib/vendor/memoize-one@6.0.0.js +0 -2
  353. package/dist/lib/vendor/normalize-wheel-es@1.2.0.js +0 -2
  354. package/dist/lib/vendor/tslib@2.3.0.js +0 -34
  355. package/dist/lib/vendor/vue-demi@0.14.5_vue@3.3.4.js +0 -4
  356. package/dist/lib/vendor/vue3-seamless-scroll@2.0.1.js +0 -564
  357. package/dist/lib/vendor/zrender@5.4.3.js +0 -17049
@@ -1,1136 +0,0 @@
1
- /**
2
- * Take input from [0, n] and return it as [0, 1]
3
- * @hidden
4
- */
5
- function bound01(n, max) {
6
- if (isOnePointZero(n)) {
7
- n = '100%';
8
- }
9
- var isPercent = isPercentage(n);
10
- n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
11
- // Automatically convert percentage into number
12
- if (isPercent) {
13
- n = parseInt(String(n * max), 10) / 100;
14
- }
15
- // Handle floating point rounding errors
16
- if (Math.abs(n - max) < 0.000001) {
17
- return 1;
18
- }
19
- // Convert into [0, 1] range if it isn't already
20
- if (max === 360) {
21
- // If n is a hue given in degrees,
22
- // wrap around out-of-range values into [0, 360] range
23
- // then convert into [0, 1].
24
- n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
25
- }
26
- else {
27
- // If n not a hue given in degrees
28
- // Convert into [0, 1] range if it isn't already.
29
- n = (n % max) / parseFloat(String(max));
30
- }
31
- return n;
32
- }
33
- /**
34
- * Force a number between 0 and 1
35
- * @hidden
36
- */
37
- function clamp01(val) {
38
- return Math.min(1, Math.max(0, val));
39
- }
40
- /**
41
- * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
42
- * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
43
- * @hidden
44
- */
45
- function isOnePointZero(n) {
46
- return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
47
- }
48
- /**
49
- * Check to see if string passed in is a percentage
50
- * @hidden
51
- */
52
- function isPercentage(n) {
53
- return typeof n === 'string' && n.indexOf('%') !== -1;
54
- }
55
- /**
56
- * Return a valid alpha value [0,1] with all invalid values being set to 1
57
- * @hidden
58
- */
59
- function boundAlpha(a) {
60
- a = parseFloat(a);
61
- if (isNaN(a) || a < 0 || a > 1) {
62
- a = 1;
63
- }
64
- return a;
65
- }
66
- /**
67
- * Replace a decimal with it's percentage value
68
- * @hidden
69
- */
70
- function convertToPercentage(n) {
71
- if (n <= 1) {
72
- return "".concat(Number(n) * 100, "%");
73
- }
74
- return n;
75
- }
76
- /**
77
- * Force a hex value to have 2 characters
78
- * @hidden
79
- */
80
- function pad2(c) {
81
- return c.length === 1 ? '0' + c : String(c);
82
- }
83
-
84
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
85
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
86
- /**
87
- * Handle bounds / percentage checking to conform to CSS color spec
88
- * <http://www.w3.org/TR/css3-color/>
89
- * *Assumes:* r, g, b in [0, 255] or [0, 1]
90
- * *Returns:* { r, g, b } in [0, 255]
91
- */
92
- function rgbToRgb(r, g, b) {
93
- return {
94
- r: bound01(r, 255) * 255,
95
- g: bound01(g, 255) * 255,
96
- b: bound01(b, 255) * 255,
97
- };
98
- }
99
- /**
100
- * Converts an RGB color value to HSL.
101
- * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
102
- * *Returns:* { h, s, l } in [0,1]
103
- */
104
- function rgbToHsl(r, g, b) {
105
- r = bound01(r, 255);
106
- g = bound01(g, 255);
107
- b = bound01(b, 255);
108
- var max = Math.max(r, g, b);
109
- var min = Math.min(r, g, b);
110
- var h = 0;
111
- var s = 0;
112
- var l = (max + min) / 2;
113
- if (max === min) {
114
- s = 0;
115
- h = 0; // achromatic
116
- }
117
- else {
118
- var d = max - min;
119
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
120
- switch (max) {
121
- case r:
122
- h = (g - b) / d + (g < b ? 6 : 0);
123
- break;
124
- case g:
125
- h = (b - r) / d + 2;
126
- break;
127
- case b:
128
- h = (r - g) / d + 4;
129
- break;
130
- }
131
- h /= 6;
132
- }
133
- return { h: h, s: s, l: l };
134
- }
135
- function hue2rgb(p, q, t) {
136
- if (t < 0) {
137
- t += 1;
138
- }
139
- if (t > 1) {
140
- t -= 1;
141
- }
142
- if (t < 1 / 6) {
143
- return p + (q - p) * (6 * t);
144
- }
145
- if (t < 1 / 2) {
146
- return q;
147
- }
148
- if (t < 2 / 3) {
149
- return p + (q - p) * (2 / 3 - t) * 6;
150
- }
151
- return p;
152
- }
153
- /**
154
- * Converts an HSL color value to RGB.
155
- *
156
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
157
- * *Returns:* { r, g, b } in the set [0, 255]
158
- */
159
- function hslToRgb(h, s, l) {
160
- var r;
161
- var g;
162
- var b;
163
- h = bound01(h, 360);
164
- s = bound01(s, 100);
165
- l = bound01(l, 100);
166
- if (s === 0) {
167
- // achromatic
168
- g = l;
169
- b = l;
170
- r = l;
171
- }
172
- else {
173
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
174
- var p = 2 * l - q;
175
- r = hue2rgb(p, q, h + 1 / 3);
176
- g = hue2rgb(p, q, h);
177
- b = hue2rgb(p, q, h - 1 / 3);
178
- }
179
- return { r: r * 255, g: g * 255, b: b * 255 };
180
- }
181
- /**
182
- * Converts an RGB color value to HSV
183
- *
184
- * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
185
- * *Returns:* { h, s, v } in [0,1]
186
- */
187
- function rgbToHsv(r, g, b) {
188
- r = bound01(r, 255);
189
- g = bound01(g, 255);
190
- b = bound01(b, 255);
191
- var max = Math.max(r, g, b);
192
- var min = Math.min(r, g, b);
193
- var h = 0;
194
- var v = max;
195
- var d = max - min;
196
- var s = max === 0 ? 0 : d / max;
197
- if (max === min) {
198
- h = 0; // achromatic
199
- }
200
- else {
201
- switch (max) {
202
- case r:
203
- h = (g - b) / d + (g < b ? 6 : 0);
204
- break;
205
- case g:
206
- h = (b - r) / d + 2;
207
- break;
208
- case b:
209
- h = (r - g) / d + 4;
210
- break;
211
- }
212
- h /= 6;
213
- }
214
- return { h: h, s: s, v: v };
215
- }
216
- /**
217
- * Converts an HSV color value to RGB.
218
- *
219
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
220
- * *Returns:* { r, g, b } in the set [0, 255]
221
- */
222
- function hsvToRgb(h, s, v) {
223
- h = bound01(h, 360) * 6;
224
- s = bound01(s, 100);
225
- v = bound01(v, 100);
226
- var i = Math.floor(h);
227
- var f = h - i;
228
- var p = v * (1 - s);
229
- var q = v * (1 - f * s);
230
- var t = v * (1 - (1 - f) * s);
231
- var mod = i % 6;
232
- var r = [v, q, p, p, t, v][mod];
233
- var g = [t, v, v, q, p, p][mod];
234
- var b = [p, p, t, v, v, q][mod];
235
- return { r: r * 255, g: g * 255, b: b * 255 };
236
- }
237
- /**
238
- * Converts an RGB color to hex
239
- *
240
- * Assumes r, g, and b are contained in the set [0, 255]
241
- * Returns a 3 or 6 character hex
242
- */
243
- function rgbToHex(r, g, b, allow3Char) {
244
- var hex = [
245
- pad2(Math.round(r).toString(16)),
246
- pad2(Math.round(g).toString(16)),
247
- pad2(Math.round(b).toString(16)),
248
- ];
249
- // Return a 3 character hex if possible
250
- if (allow3Char &&
251
- hex[0].startsWith(hex[0].charAt(1)) &&
252
- hex[1].startsWith(hex[1].charAt(1)) &&
253
- hex[2].startsWith(hex[2].charAt(1))) {
254
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
255
- }
256
- return hex.join('');
257
- }
258
- /**
259
- * Converts an RGBA color plus alpha transparency to hex
260
- *
261
- * Assumes r, g, b are contained in the set [0, 255] and
262
- * a in [0, 1]. Returns a 4 or 8 character rgba hex
263
- */
264
- // eslint-disable-next-line max-params
265
- function rgbaToHex(r, g, b, a, allow4Char) {
266
- var hex = [
267
- pad2(Math.round(r).toString(16)),
268
- pad2(Math.round(g).toString(16)),
269
- pad2(Math.round(b).toString(16)),
270
- pad2(convertDecimalToHex(a)),
271
- ];
272
- // Return a 4 character hex if possible
273
- if (allow4Char &&
274
- hex[0].startsWith(hex[0].charAt(1)) &&
275
- hex[1].startsWith(hex[1].charAt(1)) &&
276
- hex[2].startsWith(hex[2].charAt(1)) &&
277
- hex[3].startsWith(hex[3].charAt(1))) {
278
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
279
- }
280
- return hex.join('');
281
- }
282
- /** Converts a decimal to a hex value */
283
- function convertDecimalToHex(d) {
284
- return Math.round(parseFloat(d) * 255).toString(16);
285
- }
286
- /** Converts a hex value to a decimal */
287
- function convertHexToDecimal(h) {
288
- return parseIntFromHex(h) / 255;
289
- }
290
- /** Parse a base-16 hex value into a base-10 integer */
291
- function parseIntFromHex(val) {
292
- return parseInt(val, 16);
293
- }
294
- function numberInputToObject(color) {
295
- return {
296
- r: color >> 16,
297
- g: (color & 0xff00) >> 8,
298
- b: color & 0xff,
299
- };
300
- }
301
-
302
- // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
303
- /**
304
- * @hidden
305
- */
306
- var names = {
307
- aliceblue: '#f0f8ff',
308
- antiquewhite: '#faebd7',
309
- aqua: '#00ffff',
310
- aquamarine: '#7fffd4',
311
- azure: '#f0ffff',
312
- beige: '#f5f5dc',
313
- bisque: '#ffe4c4',
314
- black: '#000000',
315
- blanchedalmond: '#ffebcd',
316
- blue: '#0000ff',
317
- blueviolet: '#8a2be2',
318
- brown: '#a52a2a',
319
- burlywood: '#deb887',
320
- cadetblue: '#5f9ea0',
321
- chartreuse: '#7fff00',
322
- chocolate: '#d2691e',
323
- coral: '#ff7f50',
324
- cornflowerblue: '#6495ed',
325
- cornsilk: '#fff8dc',
326
- crimson: '#dc143c',
327
- cyan: '#00ffff',
328
- darkblue: '#00008b',
329
- darkcyan: '#008b8b',
330
- darkgoldenrod: '#b8860b',
331
- darkgray: '#a9a9a9',
332
- darkgreen: '#006400',
333
- darkgrey: '#a9a9a9',
334
- darkkhaki: '#bdb76b',
335
- darkmagenta: '#8b008b',
336
- darkolivegreen: '#556b2f',
337
- darkorange: '#ff8c00',
338
- darkorchid: '#9932cc',
339
- darkred: '#8b0000',
340
- darksalmon: '#e9967a',
341
- darkseagreen: '#8fbc8f',
342
- darkslateblue: '#483d8b',
343
- darkslategray: '#2f4f4f',
344
- darkslategrey: '#2f4f4f',
345
- darkturquoise: '#00ced1',
346
- darkviolet: '#9400d3',
347
- deeppink: '#ff1493',
348
- deepskyblue: '#00bfff',
349
- dimgray: '#696969',
350
- dimgrey: '#696969',
351
- dodgerblue: '#1e90ff',
352
- firebrick: '#b22222',
353
- floralwhite: '#fffaf0',
354
- forestgreen: '#228b22',
355
- fuchsia: '#ff00ff',
356
- gainsboro: '#dcdcdc',
357
- ghostwhite: '#f8f8ff',
358
- goldenrod: '#daa520',
359
- gold: '#ffd700',
360
- gray: '#808080',
361
- green: '#008000',
362
- greenyellow: '#adff2f',
363
- grey: '#808080',
364
- honeydew: '#f0fff0',
365
- hotpink: '#ff69b4',
366
- indianred: '#cd5c5c',
367
- indigo: '#4b0082',
368
- ivory: '#fffff0',
369
- khaki: '#f0e68c',
370
- lavenderblush: '#fff0f5',
371
- lavender: '#e6e6fa',
372
- lawngreen: '#7cfc00',
373
- lemonchiffon: '#fffacd',
374
- lightblue: '#add8e6',
375
- lightcoral: '#f08080',
376
- lightcyan: '#e0ffff',
377
- lightgoldenrodyellow: '#fafad2',
378
- lightgray: '#d3d3d3',
379
- lightgreen: '#90ee90',
380
- lightgrey: '#d3d3d3',
381
- lightpink: '#ffb6c1',
382
- lightsalmon: '#ffa07a',
383
- lightseagreen: '#20b2aa',
384
- lightskyblue: '#87cefa',
385
- lightslategray: '#778899',
386
- lightslategrey: '#778899',
387
- lightsteelblue: '#b0c4de',
388
- lightyellow: '#ffffe0',
389
- lime: '#00ff00',
390
- limegreen: '#32cd32',
391
- linen: '#faf0e6',
392
- magenta: '#ff00ff',
393
- maroon: '#800000',
394
- mediumaquamarine: '#66cdaa',
395
- mediumblue: '#0000cd',
396
- mediumorchid: '#ba55d3',
397
- mediumpurple: '#9370db',
398
- mediumseagreen: '#3cb371',
399
- mediumslateblue: '#7b68ee',
400
- mediumspringgreen: '#00fa9a',
401
- mediumturquoise: '#48d1cc',
402
- mediumvioletred: '#c71585',
403
- midnightblue: '#191970',
404
- mintcream: '#f5fffa',
405
- mistyrose: '#ffe4e1',
406
- moccasin: '#ffe4b5',
407
- navajowhite: '#ffdead',
408
- navy: '#000080',
409
- oldlace: '#fdf5e6',
410
- olive: '#808000',
411
- olivedrab: '#6b8e23',
412
- orange: '#ffa500',
413
- orangered: '#ff4500',
414
- orchid: '#da70d6',
415
- palegoldenrod: '#eee8aa',
416
- palegreen: '#98fb98',
417
- paleturquoise: '#afeeee',
418
- palevioletred: '#db7093',
419
- papayawhip: '#ffefd5',
420
- peachpuff: '#ffdab9',
421
- peru: '#cd853f',
422
- pink: '#ffc0cb',
423
- plum: '#dda0dd',
424
- powderblue: '#b0e0e6',
425
- purple: '#800080',
426
- rebeccapurple: '#663399',
427
- red: '#ff0000',
428
- rosybrown: '#bc8f8f',
429
- royalblue: '#4169e1',
430
- saddlebrown: '#8b4513',
431
- salmon: '#fa8072',
432
- sandybrown: '#f4a460',
433
- seagreen: '#2e8b57',
434
- seashell: '#fff5ee',
435
- sienna: '#a0522d',
436
- silver: '#c0c0c0',
437
- skyblue: '#87ceeb',
438
- slateblue: '#6a5acd',
439
- slategray: '#708090',
440
- slategrey: '#708090',
441
- snow: '#fffafa',
442
- springgreen: '#00ff7f',
443
- steelblue: '#4682b4',
444
- tan: '#d2b48c',
445
- teal: '#008080',
446
- thistle: '#d8bfd8',
447
- tomato: '#ff6347',
448
- turquoise: '#40e0d0',
449
- violet: '#ee82ee',
450
- wheat: '#f5deb3',
451
- white: '#ffffff',
452
- whitesmoke: '#f5f5f5',
453
- yellow: '#ffff00',
454
- yellowgreen: '#9acd32',
455
- };
456
-
457
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
458
- /**
459
- * Given a string or object, convert that input to RGB
460
- *
461
- * Possible string inputs:
462
- * ```
463
- * "red"
464
- * "#f00" or "f00"
465
- * "#ff0000" or "ff0000"
466
- * "#ff000000" or "ff000000"
467
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
468
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
469
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
470
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
471
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
472
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
473
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
474
- * ```
475
- */
476
- function inputToRGB(color) {
477
- var rgb = { r: 0, g: 0, b: 0 };
478
- var a = 1;
479
- var s = null;
480
- var v = null;
481
- var l = null;
482
- var ok = false;
483
- var format = false;
484
- if (typeof color === 'string') {
485
- color = stringInputToObject(color);
486
- }
487
- if (typeof color === 'object') {
488
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
489
- rgb = rgbToRgb(color.r, color.g, color.b);
490
- ok = true;
491
- format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
492
- }
493
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
494
- s = convertToPercentage(color.s);
495
- v = convertToPercentage(color.v);
496
- rgb = hsvToRgb(color.h, s, v);
497
- ok = true;
498
- format = 'hsv';
499
- }
500
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
501
- s = convertToPercentage(color.s);
502
- l = convertToPercentage(color.l);
503
- rgb = hslToRgb(color.h, s, l);
504
- ok = true;
505
- format = 'hsl';
506
- }
507
- if (Object.prototype.hasOwnProperty.call(color, 'a')) {
508
- a = color.a;
509
- }
510
- }
511
- a = boundAlpha(a);
512
- return {
513
- ok: ok,
514
- format: color.format || format,
515
- r: Math.min(255, Math.max(rgb.r, 0)),
516
- g: Math.min(255, Math.max(rgb.g, 0)),
517
- b: Math.min(255, Math.max(rgb.b, 0)),
518
- a: a,
519
- };
520
- }
521
- // <http://www.w3.org/TR/css3-values/#integers>
522
- var CSS_INTEGER = '[-\\+]?\\d+%?';
523
- // <http://www.w3.org/TR/css3-values/#number-value>
524
- var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
525
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
526
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
527
- // Actual matching.
528
- // Parentheses and commas are optional, but not required.
529
- // Whitespace can take the place of commas or opening paren
530
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
531
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
532
- var matchers = {
533
- CSS_UNIT: new RegExp(CSS_UNIT),
534
- rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
535
- rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
536
- hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
537
- hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
538
- hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
539
- hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
540
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
541
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
542
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
543
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
544
- };
545
- /**
546
- * Permissive string parsing. Take in a number of formats, and output an object
547
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
548
- */
549
- function stringInputToObject(color) {
550
- color = color.trim().toLowerCase();
551
- if (color.length === 0) {
552
- return false;
553
- }
554
- var named = false;
555
- if (names[color]) {
556
- color = names[color];
557
- named = true;
558
- }
559
- else if (color === 'transparent') {
560
- return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
561
- }
562
- // Try to match string input using regular expressions.
563
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
564
- // Just return an object and let the conversion functions handle that.
565
- // This way the result will be the same whether the tinycolor is initialized with string or object.
566
- var match = matchers.rgb.exec(color);
567
- if (match) {
568
- return { r: match[1], g: match[2], b: match[3] };
569
- }
570
- match = matchers.rgba.exec(color);
571
- if (match) {
572
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
573
- }
574
- match = matchers.hsl.exec(color);
575
- if (match) {
576
- return { h: match[1], s: match[2], l: match[3] };
577
- }
578
- match = matchers.hsla.exec(color);
579
- if (match) {
580
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
581
- }
582
- match = matchers.hsv.exec(color);
583
- if (match) {
584
- return { h: match[1], s: match[2], v: match[3] };
585
- }
586
- match = matchers.hsva.exec(color);
587
- if (match) {
588
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
589
- }
590
- match = matchers.hex8.exec(color);
591
- if (match) {
592
- return {
593
- r: parseIntFromHex(match[1]),
594
- g: parseIntFromHex(match[2]),
595
- b: parseIntFromHex(match[3]),
596
- a: convertHexToDecimal(match[4]),
597
- format: named ? 'name' : 'hex8',
598
- };
599
- }
600
- match = matchers.hex6.exec(color);
601
- if (match) {
602
- return {
603
- r: parseIntFromHex(match[1]),
604
- g: parseIntFromHex(match[2]),
605
- b: parseIntFromHex(match[3]),
606
- format: named ? 'name' : 'hex',
607
- };
608
- }
609
- match = matchers.hex4.exec(color);
610
- if (match) {
611
- return {
612
- r: parseIntFromHex(match[1] + match[1]),
613
- g: parseIntFromHex(match[2] + match[2]),
614
- b: parseIntFromHex(match[3] + match[3]),
615
- a: convertHexToDecimal(match[4] + match[4]),
616
- format: named ? 'name' : 'hex8',
617
- };
618
- }
619
- match = matchers.hex3.exec(color);
620
- if (match) {
621
- return {
622
- r: parseIntFromHex(match[1] + match[1]),
623
- g: parseIntFromHex(match[2] + match[2]),
624
- b: parseIntFromHex(match[3] + match[3]),
625
- format: named ? 'name' : 'hex',
626
- };
627
- }
628
- return false;
629
- }
630
- /**
631
- * Check to see if it looks like a CSS unit
632
- * (see `matchers` above for definition).
633
- */
634
- function isValidCSSUnit(color) {
635
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
636
- }
637
-
638
- var TinyColor = /** @class */ (function () {
639
- function TinyColor(color, opts) {
640
- if (color === void 0) { color = ''; }
641
- if (opts === void 0) { opts = {}; }
642
- var _a;
643
- // If input is already a tinycolor, return itself
644
- if (color instanceof TinyColor) {
645
- // eslint-disable-next-line no-constructor-return
646
- return color;
647
- }
648
- if (typeof color === 'number') {
649
- color = numberInputToObject(color);
650
- }
651
- this.originalInput = color;
652
- var rgb = inputToRGB(color);
653
- this.originalInput = color;
654
- this.r = rgb.r;
655
- this.g = rgb.g;
656
- this.b = rgb.b;
657
- this.a = rgb.a;
658
- this.roundA = Math.round(100 * this.a) / 100;
659
- this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
660
- this.gradientType = opts.gradientType;
661
- // Don't let the range of [0,255] come back in [0,1].
662
- // Potentially lose a little bit of precision here, but will fix issues where
663
- // .5 gets interpreted as half of the total, instead of half of 1
664
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
665
- if (this.r < 1) {
666
- this.r = Math.round(this.r);
667
- }
668
- if (this.g < 1) {
669
- this.g = Math.round(this.g);
670
- }
671
- if (this.b < 1) {
672
- this.b = Math.round(this.b);
673
- }
674
- this.isValid = rgb.ok;
675
- }
676
- TinyColor.prototype.isDark = function () {
677
- return this.getBrightness() < 128;
678
- };
679
- TinyColor.prototype.isLight = function () {
680
- return !this.isDark();
681
- };
682
- /**
683
- * Returns the perceived brightness of the color, from 0-255.
684
- */
685
- TinyColor.prototype.getBrightness = function () {
686
- // http://www.w3.org/TR/AERT#color-contrast
687
- var rgb = this.toRgb();
688
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
689
- };
690
- /**
691
- * Returns the perceived luminance of a color, from 0-1.
692
- */
693
- TinyColor.prototype.getLuminance = function () {
694
- // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
695
- var rgb = this.toRgb();
696
- var R;
697
- var G;
698
- var B;
699
- var RsRGB = rgb.r / 255;
700
- var GsRGB = rgb.g / 255;
701
- var BsRGB = rgb.b / 255;
702
- if (RsRGB <= 0.03928) {
703
- R = RsRGB / 12.92;
704
- }
705
- else {
706
- // eslint-disable-next-line prefer-exponentiation-operator
707
- R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
708
- }
709
- if (GsRGB <= 0.03928) {
710
- G = GsRGB / 12.92;
711
- }
712
- else {
713
- // eslint-disable-next-line prefer-exponentiation-operator
714
- G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
715
- }
716
- if (BsRGB <= 0.03928) {
717
- B = BsRGB / 12.92;
718
- }
719
- else {
720
- // eslint-disable-next-line prefer-exponentiation-operator
721
- B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
722
- }
723
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
724
- };
725
- /**
726
- * Returns the alpha value of a color, from 0-1.
727
- */
728
- TinyColor.prototype.getAlpha = function () {
729
- return this.a;
730
- };
731
- /**
732
- * Sets the alpha value on the current color.
733
- *
734
- * @param alpha - The new alpha value. The accepted range is 0-1.
735
- */
736
- TinyColor.prototype.setAlpha = function (alpha) {
737
- this.a = boundAlpha(alpha);
738
- this.roundA = Math.round(100 * this.a) / 100;
739
- return this;
740
- };
741
- /**
742
- * Returns whether the color is monochrome.
743
- */
744
- TinyColor.prototype.isMonochrome = function () {
745
- var s = this.toHsl().s;
746
- return s === 0;
747
- };
748
- /**
749
- * Returns the object as a HSVA object.
750
- */
751
- TinyColor.prototype.toHsv = function () {
752
- var hsv = rgbToHsv(this.r, this.g, this.b);
753
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
754
- };
755
- /**
756
- * Returns the hsva values interpolated into a string with the following format:
757
- * "hsva(xxx, xxx, xxx, xx)".
758
- */
759
- TinyColor.prototype.toHsvString = function () {
760
- var hsv = rgbToHsv(this.r, this.g, this.b);
761
- var h = Math.round(hsv.h * 360);
762
- var s = Math.round(hsv.s * 100);
763
- var v = Math.round(hsv.v * 100);
764
- return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
765
- };
766
- /**
767
- * Returns the object as a HSLA object.
768
- */
769
- TinyColor.prototype.toHsl = function () {
770
- var hsl = rgbToHsl(this.r, this.g, this.b);
771
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
772
- };
773
- /**
774
- * Returns the hsla values interpolated into a string with the following format:
775
- * "hsla(xxx, xxx, xxx, xx)".
776
- */
777
- TinyColor.prototype.toHslString = function () {
778
- var hsl = rgbToHsl(this.r, this.g, this.b);
779
- var h = Math.round(hsl.h * 360);
780
- var s = Math.round(hsl.s * 100);
781
- var l = Math.round(hsl.l * 100);
782
- return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
783
- };
784
- /**
785
- * Returns the hex value of the color.
786
- * @param allow3Char will shorten hex value to 3 char if possible
787
- */
788
- TinyColor.prototype.toHex = function (allow3Char) {
789
- if (allow3Char === void 0) { allow3Char = false; }
790
- return rgbToHex(this.r, this.g, this.b, allow3Char);
791
- };
792
- /**
793
- * Returns the hex value of the color -with a # prefixed.
794
- * @param allow3Char will shorten hex value to 3 char if possible
795
- */
796
- TinyColor.prototype.toHexString = function (allow3Char) {
797
- if (allow3Char === void 0) { allow3Char = false; }
798
- return '#' + this.toHex(allow3Char);
799
- };
800
- /**
801
- * Returns the hex 8 value of the color.
802
- * @param allow4Char will shorten hex value to 4 char if possible
803
- */
804
- TinyColor.prototype.toHex8 = function (allow4Char) {
805
- if (allow4Char === void 0) { allow4Char = false; }
806
- return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
807
- };
808
- /**
809
- * Returns the hex 8 value of the color -with a # prefixed.
810
- * @param allow4Char will shorten hex value to 4 char if possible
811
- */
812
- TinyColor.prototype.toHex8String = function (allow4Char) {
813
- if (allow4Char === void 0) { allow4Char = false; }
814
- return '#' + this.toHex8(allow4Char);
815
- };
816
- /**
817
- * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
818
- * @param allowShortChar will shorten hex value to 3 or 4 char if possible
819
- */
820
- TinyColor.prototype.toHexShortString = function (allowShortChar) {
821
- if (allowShortChar === void 0) { allowShortChar = false; }
822
- return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
823
- };
824
- /**
825
- * Returns the object as a RGBA object.
826
- */
827
- TinyColor.prototype.toRgb = function () {
828
- return {
829
- r: Math.round(this.r),
830
- g: Math.round(this.g),
831
- b: Math.round(this.b),
832
- a: this.a,
833
- };
834
- };
835
- /**
836
- * Returns the RGBA values interpolated into a string with the following format:
837
- * "RGBA(xxx, xxx, xxx, xx)".
838
- */
839
- TinyColor.prototype.toRgbString = function () {
840
- var r = Math.round(this.r);
841
- var g = Math.round(this.g);
842
- var b = Math.round(this.b);
843
- return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
844
- };
845
- /**
846
- * Returns the object as a RGBA object.
847
- */
848
- TinyColor.prototype.toPercentageRgb = function () {
849
- var fmt = function (x) { return "".concat(Math.round(bound01(x, 255) * 100), "%"); };
850
- return {
851
- r: fmt(this.r),
852
- g: fmt(this.g),
853
- b: fmt(this.b),
854
- a: this.a,
855
- };
856
- };
857
- /**
858
- * Returns the RGBA relative values interpolated into a string
859
- */
860
- TinyColor.prototype.toPercentageRgbString = function () {
861
- var rnd = function (x) { return Math.round(bound01(x, 255) * 100); };
862
- return this.a === 1
863
- ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)")
864
- : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
865
- };
866
- /**
867
- * The 'real' name of the color -if there is one.
868
- */
869
- TinyColor.prototype.toName = function () {
870
- if (this.a === 0) {
871
- return 'transparent';
872
- }
873
- if (this.a < 1) {
874
- return false;
875
- }
876
- var hex = '#' + rgbToHex(this.r, this.g, this.b, false);
877
- for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
878
- var _b = _a[_i], key = _b[0], value = _b[1];
879
- if (hex === value) {
880
- return key;
881
- }
882
- }
883
- return false;
884
- };
885
- TinyColor.prototype.toString = function (format) {
886
- var formatSet = Boolean(format);
887
- format = format !== null && format !== void 0 ? format : this.format;
888
- var formattedString = false;
889
- var hasAlpha = this.a < 1 && this.a >= 0;
890
- var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');
891
- if (needsAlphaFormat) {
892
- // Special case for "transparent", all other non-alpha formats
893
- // will return rgba when there is transparency.
894
- if (format === 'name' && this.a === 0) {
895
- return this.toName();
896
- }
897
- return this.toRgbString();
898
- }
899
- if (format === 'rgb') {
900
- formattedString = this.toRgbString();
901
- }
902
- if (format === 'prgb') {
903
- formattedString = this.toPercentageRgbString();
904
- }
905
- if (format === 'hex' || format === 'hex6') {
906
- formattedString = this.toHexString();
907
- }
908
- if (format === 'hex3') {
909
- formattedString = this.toHexString(true);
910
- }
911
- if (format === 'hex4') {
912
- formattedString = this.toHex8String(true);
913
- }
914
- if (format === 'hex8') {
915
- formattedString = this.toHex8String();
916
- }
917
- if (format === 'name') {
918
- formattedString = this.toName();
919
- }
920
- if (format === 'hsl') {
921
- formattedString = this.toHslString();
922
- }
923
- if (format === 'hsv') {
924
- formattedString = this.toHsvString();
925
- }
926
- return formattedString || this.toHexString();
927
- };
928
- TinyColor.prototype.toNumber = function () {
929
- return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
930
- };
931
- TinyColor.prototype.clone = function () {
932
- return new TinyColor(this.toString());
933
- };
934
- /**
935
- * Lighten the color a given amount. Providing 100 will always return white.
936
- * @param amount - valid between 1-100
937
- */
938
- TinyColor.prototype.lighten = function (amount) {
939
- if (amount === void 0) { amount = 10; }
940
- var hsl = this.toHsl();
941
- hsl.l += amount / 100;
942
- hsl.l = clamp01(hsl.l);
943
- return new TinyColor(hsl);
944
- };
945
- /**
946
- * Brighten the color a given amount, from 0 to 100.
947
- * @param amount - valid between 1-100
948
- */
949
- TinyColor.prototype.brighten = function (amount) {
950
- if (amount === void 0) { amount = 10; }
951
- var rgb = this.toRgb();
952
- rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
953
- rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
954
- rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
955
- return new TinyColor(rgb);
956
- };
957
- /**
958
- * Darken the color a given amount, from 0 to 100.
959
- * Providing 100 will always return black.
960
- * @param amount - valid between 1-100
961
- */
962
- TinyColor.prototype.darken = function (amount) {
963
- if (amount === void 0) { amount = 10; }
964
- var hsl = this.toHsl();
965
- hsl.l -= amount / 100;
966
- hsl.l = clamp01(hsl.l);
967
- return new TinyColor(hsl);
968
- };
969
- /**
970
- * Mix the color with pure white, from 0 to 100.
971
- * Providing 0 will do nothing, providing 100 will always return white.
972
- * @param amount - valid between 1-100
973
- */
974
- TinyColor.prototype.tint = function (amount) {
975
- if (amount === void 0) { amount = 10; }
976
- return this.mix('white', amount);
977
- };
978
- /**
979
- * Mix the color with pure black, from 0 to 100.
980
- * Providing 0 will do nothing, providing 100 will always return black.
981
- * @param amount - valid between 1-100
982
- */
983
- TinyColor.prototype.shade = function (amount) {
984
- if (amount === void 0) { amount = 10; }
985
- return this.mix('black', amount);
986
- };
987
- /**
988
- * Desaturate the color a given amount, from 0 to 100.
989
- * Providing 100 will is the same as calling greyscale
990
- * @param amount - valid between 1-100
991
- */
992
- TinyColor.prototype.desaturate = function (amount) {
993
- if (amount === void 0) { amount = 10; }
994
- var hsl = this.toHsl();
995
- hsl.s -= amount / 100;
996
- hsl.s = clamp01(hsl.s);
997
- return new TinyColor(hsl);
998
- };
999
- /**
1000
- * Saturate the color a given amount, from 0 to 100.
1001
- * @param amount - valid between 1-100
1002
- */
1003
- TinyColor.prototype.saturate = function (amount) {
1004
- if (amount === void 0) { amount = 10; }
1005
- var hsl = this.toHsl();
1006
- hsl.s += amount / 100;
1007
- hsl.s = clamp01(hsl.s);
1008
- return new TinyColor(hsl);
1009
- };
1010
- /**
1011
- * Completely desaturates a color into greyscale.
1012
- * Same as calling `desaturate(100)`
1013
- */
1014
- TinyColor.prototype.greyscale = function () {
1015
- return this.desaturate(100);
1016
- };
1017
- /**
1018
- * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
1019
- * Values outside of this range will be wrapped into this range.
1020
- */
1021
- TinyColor.prototype.spin = function (amount) {
1022
- var hsl = this.toHsl();
1023
- var hue = (hsl.h + amount) % 360;
1024
- hsl.h = hue < 0 ? 360 + hue : hue;
1025
- return new TinyColor(hsl);
1026
- };
1027
- /**
1028
- * Mix the current color a given amount with another color, from 0 to 100.
1029
- * 0 means no mixing (return current color).
1030
- */
1031
- TinyColor.prototype.mix = function (color, amount) {
1032
- if (amount === void 0) { amount = 50; }
1033
- var rgb1 = this.toRgb();
1034
- var rgb2 = new TinyColor(color).toRgb();
1035
- var p = amount / 100;
1036
- var rgba = {
1037
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
1038
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
1039
- b: (rgb2.b - rgb1.b) * p + rgb1.b,
1040
- a: (rgb2.a - rgb1.a) * p + rgb1.a,
1041
- };
1042
- return new TinyColor(rgba);
1043
- };
1044
- TinyColor.prototype.analogous = function (results, slices) {
1045
- if (results === void 0) { results = 6; }
1046
- if (slices === void 0) { slices = 30; }
1047
- var hsl = this.toHsl();
1048
- var part = 360 / slices;
1049
- var ret = [this];
1050
- for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {
1051
- hsl.h = (hsl.h + part) % 360;
1052
- ret.push(new TinyColor(hsl));
1053
- }
1054
- return ret;
1055
- };
1056
- /**
1057
- * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
1058
- */
1059
- TinyColor.prototype.complement = function () {
1060
- var hsl = this.toHsl();
1061
- hsl.h = (hsl.h + 180) % 360;
1062
- return new TinyColor(hsl);
1063
- };
1064
- TinyColor.prototype.monochromatic = function (results) {
1065
- if (results === void 0) { results = 6; }
1066
- var hsv = this.toHsv();
1067
- var h = hsv.h;
1068
- var s = hsv.s;
1069
- var v = hsv.v;
1070
- var res = [];
1071
- var modification = 1 / results;
1072
- while (results--) {
1073
- res.push(new TinyColor({ h: h, s: s, v: v }));
1074
- v = (v + modification) % 1;
1075
- }
1076
- return res;
1077
- };
1078
- TinyColor.prototype.splitcomplement = function () {
1079
- var hsl = this.toHsl();
1080
- var h = hsl.h;
1081
- return [
1082
- this,
1083
- new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
1084
- new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),
1085
- ];
1086
- };
1087
- /**
1088
- * Compute how the color would appear on a background
1089
- */
1090
- TinyColor.prototype.onBackground = function (background) {
1091
- var fg = this.toRgb();
1092
- var bg = new TinyColor(background).toRgb();
1093
- var alpha = fg.a + bg.a * (1 - fg.a);
1094
- return new TinyColor({
1095
- r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
1096
- g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
1097
- b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
1098
- a: alpha,
1099
- });
1100
- };
1101
- /**
1102
- * Alias for `polyad(3)`
1103
- */
1104
- TinyColor.prototype.triad = function () {
1105
- return this.polyad(3);
1106
- };
1107
- /**
1108
- * Alias for `polyad(4)`
1109
- */
1110
- TinyColor.prototype.tetrad = function () {
1111
- return this.polyad(4);
1112
- };
1113
- /**
1114
- * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
1115
- * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
1116
- */
1117
- TinyColor.prototype.polyad = function (n) {
1118
- var hsl = this.toHsl();
1119
- var h = hsl.h;
1120
- var result = [this];
1121
- var increment = 360 / n;
1122
- for (var i = 1; i < n; i++) {
1123
- result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));
1124
- }
1125
- return result;
1126
- };
1127
- /**
1128
- * compare color vs current color
1129
- */
1130
- TinyColor.prototype.equals = function (color) {
1131
- return this.toRgbString() === new TinyColor(color).toRgbString();
1132
- };
1133
- return TinyColor;
1134
- }());
1135
-
1136
- export { TinyColor as T };