easy-util-tools
  • 👋Welcome to easy-util-tools
  • baseClass(基本类)
    • Color(颜色)
    • Point(点)
    • Line(线)
    • Circle(圆)
    • Rectangle(矩形)
    • Gradient(渐变色)
    • TimeMonitoring(时间统计)
  • utils(工具)
    • formatAmount(格式金额)
    • getStandardCoordinate
Powered by GitBook
On this page
  1. baseClass(基本类)

Gradient(渐变色)

This class can implement a custom color spectrum, and then obtain the color return value type at any point on the color spectrum is Color, please refer to the Color class for details

// Import the module
import { Gradient } from 'easy-util-tools'

// The Instantiate Class parameter is an array of Color class instances
let gradient = new Gradient([
    new Color(0, 0, 0),
    new Color(255, 255, 255)
])

// Get color values The value interval of the Get Color Value parameter is a decimal number between 0-1
let color = grandient.getColor(v)

//exampleResetsChromatography
gradient.chromatogram = []
PreviousRectangle(矩形)NextTimeMonitoring(时间统计)

Last updated 2 years ago