This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch fix-gradient in repository https://gitbox.apache.org/repos/asf/echarts-doc.git
commit 5e6ba8bbad8270d85b8c792039fa34042aa8548f Author: Ovilia <zwl.s...@gmail.com> AuthorDate: Tue Jan 18 13:42:13 2022 +0800 fix: add color desc for en --- en/option/option.md | 40 +++++++++++++++++++++++++++++++++++++++- zh/option/option.md | 2 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/en/option/option.md b/en/option/option.md index 6ecff7e..510f8b7 100644 --- a/en/option/option.md +++ b/en/option/option.md @@ -59,6 +59,45 @@ Defaults: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'] ``` +Supported color formats. + ++ Use RGB for colors, like `'rgb(128, 128, 128)'`, or RGBA if you want to add an alpha channel for opacity, like `'rgba(128, 128, 128, 0.5)`, or use hex string, like `'#ccc'`. + ++ Gradient Color or Texture +```js +// Linear gradient with first four parameters x0, y0, x2, y2, ranging from 0 - 1, corresponding to the percentage in the graphical wraparound box, if globalCoord is ``true``, then the four values are absolute pixel positions +{ + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [{ + offset: 0, color: 'red' // color at 0% + }, { + offset: 1, color: 'blue' // color at 100% + }], + global: false // default is false +} +// Radial gradient, the first three parameters are the center x, y and radius, the values are the same as the linear gradient +{ + type: 'radial', + x: 0.5, + y: 0.5, + r: 0.5, + colorStops: [{ + offset: 0, color: 'red' // color at 0% + }, { + offset: 1, color: 'blue' // color at 100% + }], + global: false // default is false +} +// Texture fill +{ + image: imageDom, // supported as HTMLImageElement, HTMLCanvasElement, path string not supported + repeat: 'repeat' // whether to tile, can be 'repeat-x', 'repeat-y', 'no-repeat' +} +``` # backgroundColor(Color) Background color. Defaults to have no background. @@ -177,4 +216,3 @@ color: { repeat: 'repeat' // whether to repeat texture, whose value can be repeat-x, repeat-y, or no-repeat } ``` - diff --git a/zh/option/option.md b/zh/option/option.md index 2b2f863..b61eb4a 100644 --- a/zh/option/option.md +++ b/zh/option/option.md @@ -66,7 +66,7 @@ 支持的颜色格式: -+ 使用 RGB 表示纯颜色,比如 `'rgb(128, 128, 128)'`,如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如 `'rgba(128, 128, 128, 0.5)'`,也可以使用十六进制格式,比如 `'#ccc'`。 ++ 使用 RGB 表示颜色,比如 `'rgb(128, 128, 128)'`,如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如 `'rgba(128, 128, 128, 0.5)'`,也可以使用十六进制格式,比如 `'#ccc'`。 + 渐变色或者纹理填充 ```js --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org