PINE LIBRARY
ColorGradient

Library "ColorGradient"
Library for creating color gradients and palettes with hex colors
hexToColor(hexStr)
hexToColor
Parameters:
hexStr (string): Hex color string (e.g., "#FF0000" or "FF0000")
Returns: color value
gradientStep(color1, color2, steps, step)
gradientStep
Parameters:
color1 (string): Starting color (hex string)
color2 (string): Ending color (hex string)
steps (int): Number of steps including start and end
step (int): Current step (0 to steps-1)
Returns: Interpolated color
multiGradientStep(colors, totalSteps, step)
multiGradientStep
Parameters:
colors (array<string>): Array of hex color strings
totalSteps (int): Total number of steps across all colors
step (int): Current step (0 to totalSteps-1)
Returns: Interpolated color
applyPaletteStyle(hexStr, style)
applyPaletteStyle
Parameters:
hexStr (string): Hex color string
style (string): "normal", "pale", "pastel", "bright", "matte"
Returns: Adjusted color
getStyledGradient(colors, totalSteps, step, style)
getStyledGradient
Parameters:
colors (array<string>): Array of hex color strings
totalSteps (int): Total number of steps
step (int): Current step
style (string): Palette style ("normal", "pale", "pastel", "bright", "matte")
Returns: Styled color
Library for creating color gradients and palettes with hex colors
hexToColor(hexStr)
hexToColor
Parameters:
hexStr (string): Hex color string (e.g., "#FF0000" or "FF0000")
Returns: color value
gradientStep(color1, color2, steps, step)
gradientStep
Parameters:
color1 (string): Starting color (hex string)
color2 (string): Ending color (hex string)
steps (int): Number of steps including start and end
step (int): Current step (0 to steps-1)
Returns: Interpolated color
multiGradientStep(colors, totalSteps, step)
multiGradientStep
Parameters:
colors (array<string>): Array of hex color strings
totalSteps (int): Total number of steps across all colors
step (int): Current step (0 to totalSteps-1)
Returns: Interpolated color
applyPaletteStyle(hexStr, style)
applyPaletteStyle
Parameters:
hexStr (string): Hex color string
style (string): "normal", "pale", "pastel", "bright", "matte"
Returns: Adjusted color
getStyledGradient(colors, totalSteps, step, style)
getStyledGradient
Parameters:
colors (array<string>): Array of hex color strings
totalSteps (int): Total number of steps
step (int): Current step
style (string): Palette style ("normal", "pale", "pastel", "bright", "matte")
Returns: Styled color
Pine脚本库
秉承TradingView的精神,作者已将此Pine代码作为开源库发布,以便我们社区的其他Pine程序员可以重用它。向作者致敬!您可以私下或在其他开源出版物中使用此库,但在出版物中重用此代码须遵守网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
Pine脚本库
秉承TradingView的精神,作者已将此Pine代码作为开源库发布,以便我们社区的其他Pine程序员可以重用它。向作者致敬!您可以私下或在其他开源出版物中使用此库,但在出版物中重用此代码须遵守网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。