Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dizhen-ui
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
dizhen-ui
Commits
4b276dad
Commit
4b276dad
authored
May 27, 2025
by
zhaopanyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zpy
parent
ea809f6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletions
+69
-1
src/views/test/testIma.vue
+69
-1
No files found.
src/views/test/testIma.vue
View file @
4b276dad
...
@@ -337,7 +337,7 @@ export default {
...
@@ -337,7 +337,7 @@ export default {
},
},
// 添加颜色映射选择器
// 添加颜色映射选择器
currentColorMap
:
'CustomGrayScale'
,
// 默认使用灰度渐变
currentColorMap
:
'CustomGrayScale'
,
// 默认使用灰度渐变
colorMaps
:
[
'CustomGrayScale'
,
'CustomRedScale'
],
// 可用的颜色映射
colorMaps
:
[
'CustomGrayScale'
,
'CustomRedScale'
,
'CustomGrayScale2'
],
// 可用的颜色映射
textStyle
:
{
textStyle
:
{
color
:
'#000000'
,
color
:
'#000000'
,
size
:
22
,
size
:
22
,
...
@@ -1449,6 +1449,74 @@ export default {
...
@@ -1449,6 +1449,74 @@ export default {
}
}
});
});
// 注册灰度渐变色映射
colorProvider
.
register
(
'CustomGrayScale2'
,
(
map
)
=>
{
if
(
!
map
)
{
console
.
error
(
'CustomGrayScale2映射对象为空'
);
return
;
}
const
colors
=
new
Array
(
255
);
try
{
// -4000到181范围保持纯白色
interpolate
(
colors
,
0
,
110
,
{
A
:
255
,
R
:
255
,
G
:
255
,
B
:
255
},
{
A
:
255
,
R
:
255
,
G
:
255
,
B
:
255
});
// 181开始,从(253,253,253)开始到566
interpolate
(
colors
,
111
,
120
,
{
A
:
255
,
R
:
253
,
G
:
253
,
B
:
253
},
{
A
:
255
,
R
:
240
,
G
:
240
,
B
:
240
});
// 566开始,颜色开始变深
interpolate
(
colors
,
121
,
160
,
{
A
:
255
,
R
:
240
,
G
:
240
,
B
:
240
},
{
A
:
255
,
R
:
180
,
G
:
180
,
B
:
180
});
// 继续渐变到深色
interpolate
(
colors
,
161
,
254
,
{
A
:
255
,
R
:
180
,
G
:
180
,
B
:
180
},
{
A
:
255
,
R
:
6
,
G
:
6
,
B
:
6
});
map
.
set
(
colors
);
}
catch
(
error
)
{
console
.
error
(
'设置CustomGrayScale2颜色映射失败:'
,
error
);
}
});
console
.
log
(
'颜色映射注册成功'
);
console
.
log
(
'颜色映射注册成功'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'注册颜色映射失败:'
,
error
);
console
.
error
(
'注册颜色映射失败:'
,
error
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment