Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-06-28 17:22:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9cd6d0da07485f5d0be4fb641b04f35e4589792c
9cd6d0da
1 parent
1dd8303c
feat:优化早晚报
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/default_head_userPage.png
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
9cd6d0d
...
...
@@ -238,20 +238,20 @@ export struct MorningEveningPaperComponent {
private async pickColor(imageSource: image.ImageSource | undefined) {
if (imageSource) {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
let allPixels: number[] = await traverseAllPixel(pixelMap);
let maxPixel: number = findMaxPixel(allPixels);
let rgb: ColorRgb = ColorUtils.numberToRgb(maxPixel);
let hsv: ColorHsv = ColorUtils.rgb2hsv(rgb);
rgb = ColorUtils.hsv2rgb(hsv);
this.mixedBgColor = "#" + rgb.red.toString(16) + rgb.green.toString(16) + rgb.blue.toString(16);
// effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
// let color = colorPicker.getMainColorSync();
// console.log(TAG, "compInfoBean compStyle = " + color)
// // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// // 将取色器选取的color示例转换为十六进制颜色代码
// this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
// console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
// });
// let allPixels: number[] = await traverseAllPixel(pixelMap);
// let maxPixel: number = findMaxPixel(allPixels);
// let rgb: ColorRgb = ColorUtils.numberToRgb(maxPixel);
// let hsv: ColorHsv = ColorUtils.rgb2hsv(rgb);
// rgb = ColorUtils.hsv2rgb(hsv);
// this.mixedBgColor = "#" + rgb.red.toString(16) + rgb.green.toString(16) + rgb.blue.toString(16);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getMainColorSync();
console.log(TAG, "compInfoBean compStyle = " + color)
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
View file @
9cd6d0d
...
...
@@ -39,8 +39,8 @@ export default struct MinePageUserSimpleInfoUI {
//头像
Stack(){
Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head'))
.alt($r('app.media.default_head'))
Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head_userPage'))
.alt($r('app.media.default_head_userPage'))
.width(`${this.calcHeight(120)}lpx`)
.height(`${this.calcHeight(120)}lpx`)
.objectFit(ImageFit.Cover)
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/default_head_userPage.png
0 → 100644
View file @
9cd6d0d
16.2 KB
Please
register
or
login
to post a comment