Electrified

Color

Electrified Cập nhật   
Utility for working with colors.

Get the luminosity of a color and determine the optimal (black or white) foreground color.
Phát hành các Ghi chú:
v2

Added:
equals(color a, color b) function that deals with na values.
Phát hành các Ghi chú:
v3

Added:
tostringRGBT(color)
  Converts a color value to a string in the "rgbt(r,g,b,t)" format.
  Parameters:
    color: The color to convert.
  Returns: The color value as a string.

toHexChar(n)
  Converts an integer between 0 and 15 to its hex equivalent character.
  Parameters:
    n: The integer value to convert.

byteToHex(n)
  Converts an integer from 0 to 255 to a 2-character hex string.
  Parameters:
    n: The integer value to convert.

toHex(color)
  Converts a color to its hex string (#FFFFFF).
  Parameters:
    color
  Returns: The six digit hex string.
Phát hành các Ghi chú:
v4

Updated:
getContrastColor(bgColor, keepNa)
  Returns a color that is either black or white depending on the luminosity of the given background color. If the background color is na, returns gray.
  Parameters:
    bgColor: The background color to determine the contrast color for.
    keepNa: When true and the value of bgColor is na the return value will be na; otherwise the if bgColor is na the return will be gray.
  Returns: A color that provides high contrast with the given background color.
Phát hành các Ghi chú:
v5
Phát hành các Ghi chú:
v6

Added:
brighten(c, value)
  Proportionally adjusts the RGB values of a color. A value of positive (+) 100 will result in white. A value of negative (-) 100 will result in black.
  Parameters:
    c: The color to adjust.
    value: The amount (-100 to +100) to adjust the color by. Values less than -100 or greater than +100 will be clamped.
  Returns: The resultant color.

darken(c, value)
  Proportionally adjusts the RGB values of a color. A value of positive (+) 100 will result in black. A value of negative (-) 100 will result in white.
  Parameters:
    c: The color to adjust.
    value: The amount (-100 to +100) to adjust the color by. Values less than -100 or greater than +100 will be clamped.
  Returns: The resultant color.
Phát hành các Ghi chú:
v7 Fixes to brighten
Phát hành các Ghi chú:
v8 Fixes to brighten
Phát hành các Ghi chú:
v9 Added extension syntax.
Thư viện Pine

Với tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác từ cộng đồng của chúng tôi có thể sử dụng lại nó. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này một cách riêng tư hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy chung.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng thư viện này?

Sao chép văn bản vào khay nhớ tạm và dán nó vào tập lệnh của bạn.