npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oh-expo/expo-linear-gradient

v55.0.18-harmony.0

Published

expo-linear-gradient 的 HarmonyOS 适配包(ExpoView 组件模块,expo-modules-core 体系)

Readme

@oh-expo/expo-linear-gradient

让 expo-linear-gradient(线性渐变)在 HarmonyOS / OpenHarmony 上运行的适配包。

通过 expo-modules-core 体系提供 ExpoLinearGradientModule 原生模块 + ExpoLinearGradientView 组件(ExpoView 机制),接口收口自 [email protected] 权威 d.ts。

支持基线

| 项 | 值 | | --- | --- | | 适配目标 | [email protected] | | 运行时底座 | @expo-harmony/[email protected](本地 HAR) | | 鸿蒙 SDK | API 26(SDK 26.0.0 锚定,@kit.ArkUI Canvas + CanvasRenderingContext2D) | | 权限 | 无 |

实现面

  • ExpoLinearGradientView 组件 props:colors(number/string 双形)、locations、 startPoint / endPoint(归一化 0~1 点)、borderRadii、dither(no-op 兼容);
  • 渲染:Canvas createLinearGradient + addColorStop + fillRect,onReady/onAreaChange 重绘,borderRadius + clip 圆角裁剪;onDidUpdateProps 触发重绘;
  • 诚实分级:无效 colors/locations 更新忽略(warn),不做猜测渲染。

快速开始

  1. 安装 npm 包(peer 依赖 expo-linear-gradient 原包与 expo-modules-core 自动安装):

    npm install @oh-expo/expo-linear-gradient
  2. 拷贝 HAR 到宿主并声明 ohpm 依赖:

    cp node_modules/@oh-expo/expo-linear-gradient/local-hars/expo_linear_gradient.har harmony/local-hars/
    // harmony/oh-package.json5
    { "dependencies": { "@oh-expo/expo-linear-gradient": "file:local-hars/expo_linear_gradient.har" } }
  3. JS 侧使用(对外契约由原包提供):

    import { LinearGradient } from 'expo-linear-gradient';

构建与校验

pnpm har:prepare    # hvigorw assembleHar → local-hars/expo_linear_gradient.har
pnpm har:prepack    # 发布前校验(必需文件 / scope / -harmony.N 版本 / HAR 产物)

状态与来源

  • ⚠️ 实现已落盘并经 assembleHar / 宿主接入编译验证(真机功能验证 ⏳);
  • 接口契约锚定 [email protected] 权威 d.ts,规格见主仓 docs/adaptations/expo-linear-gradient.md 与 acceptance/ledger.md(S4 前置门口径)。