ToClrToStrContains functions for conversion of color to string and vice versa:
method toClr( string this ) - converts string reperesentation of color (in hex format) to color
method toHex( color this ) - converts color to string (hex form)
method toRgb( color this ) - converts color to string ("rgb(11,11,11,0)" form)
Thanks to @ImmortalFreedom for his `color_tostring()` function from "RGB Color Fiddler"
RGB
RGB Color Codes Chart█ OVERVIEW
This indicator is an educational indicator to make pine coders easier to input color code.
Color code displayed either in hex or rgb code or both.
█ INSPIRATIONS
RGB Color Codes Chart
Table Color For Pairing Black And White
█ FEATURES
Hover table cell to see all properties of color such as Hex code and RGB code via tooltip.
Cell can be show either Full, HEX, RGB, R, G, B or na.
█ LIMITATION
This code does not consider usage of color.new()
█ CONSIDERATION
Code consideration to be used such as color.r(), color.g(), color.b() and color.rgb()
█ EXAMPLE OF USAGE / EXPLAINATION
ColorUtility for working with colors.
Get the luminosity of a color and determine the optimal (black or white) foreground color.
HSV and HSL gradient Tools ( Built-in Drop-in replacement )Library "hsvColor"
HSV and HSL Gradient Tool Alternatives and helpers. Demo'd is built-in in the middle with HSL/HSV gradients on top/bottom
TODO: Solve for #000000 issue
rgbhsv(_col)
RGB Color to HSV Values
Parameters:
_col : Color input (#abc012 or color.name or color.rgb(0,0,0,0))
Returns: values
rgbhsv(_r, _g, _b, _t)
RGB Color to HSV Values
Parameters:
_r : Red 0 - 255
_g : Green 0 - 255
_b : Blue 0 - 255
_t : Transp 0 - 100
Returns: values
hsv(_h, _s, _v, _a)
HSV colors, Auto fix if past boundaries
Parameters:
_h : Hue Input (-360 - 360) or further
_s : Saturation 0.- 1.
_v : Value 0.- 1.
_a : Alpha 0.- 1.
Returns: Color output
hue(_col)
returns 0-359 hue on color wheel
Parameters:
_col :
Returns: 360 degree hue value
hsv_gradient(signal, _startVal, _endVal, _startCol, _endCol)
Color Gradient Replacement Function for HSV calculated Gradents
Parameters:
signal : Control signal
_startVal : start color limit
_endVal : end color limit
_startCol : start color
_endCol : end color
Returns: HSV calculated gradient
hsl_gradient(signal, _startVal, _endVal, _startCol, _endCol)
Color Gradient Replacement Function for HSV calculated Gradents
Parameters:
signal : Control signal
_startVal : start color limit
_endVal : end color limit
_startCol : start color
_endCol : end color
Returns: HSV calculated gradient
RGB Color FiddlerKEEP YOUR COINS FOLKS! I DON'T NEED THEM, DON'T WANT THEM. Many other talented authors on TV deserve them.
INTRODUCTION:
This is my "RGB Color Fiddler", intended as a toy to play with. This colorcator is rated 'E' for every TV member. With this you can quickly generate about 1.67 million potential colors from color.rgb(). While I have a few preferred colors that are ideal for use, this allows you to finely tune colors to anything that pleases your eye on your canvas.
TIPS:
The overlay chart can be peppered with colors of all varieties, so it's necessary to have properly distinguished coloring and contrast separation. If you employ light charts, you can tweak colors to just the right shade you desire on your display. Not all LCDs are created equal, even when color calibrated. With specific discovered colors tailored to your liking, you may uniquely color code ALL of your indicators.
UTILITY:
The input()s in Settings allow up to 4 different colors to tinker with and compare. After selecting focus of an input, you can easily use the up/down keyboard keys to make swift adjustments numerically or with options. The color combos you are creating will be displayed in color hex or a RGB representation within the labels.
Also of great benefit, is the ability to cycle through the currently available plot() styles. Some styles will require you to zoom in closeup to observe their behaviors. There is a few other ways to finagle plot() parameters to also achieve other acrobatic effects that are not demonstrated here. Closer study of plot() parameters in the reference can reveal those. Anyhow, I won't bother you with more elaborate technical jargon, now is the time to fiddle with this toy to your benefit!
CODE REUSE:
Any member has the freedom to use any of the code in this script any way they see fit. It's specifically intended for all. There is absolutely no need for accreditation for any of this code reuse ever, in the present case. Don't worry about, I'm certainly not.
When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members , I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
RGB color check tool with RSI [DM]Greetings colleagues.
Here I share a tool that uses the color gradient provided by PineCoders and lucf.
This tool was made for the reason that whenever we start with an idea for a script, we end up consuming a lot of time in selecting suitable colors.
An RSI was taken as a reference for the signal
You have multiple switches for axes, fill, background and colors
You can also change the background so that you can check the contrast with the signals.
The mix of colors with 8 boxes (4 channels for each color as detailed below) for each color since RGB has been defined
Red= 0 a 255
Green= 0 a 255
Blue= 0 a 255
Transparency= 0 a 100
I hope you enjoy it. [ ;-)
Line & Label RGB Color Editor [DW]This script is a template designed to provide developers with UI color customization for v4 lines and labels.
The color pallete used within this script is a full spectrum "web safe" format with 216 colors to choose from.
Colors are easily modified via the RGB inputs. The designated color selector function takes in the RGB values and returns the corresponding hex color.
Transparency can be modified as well. However, the color.new function only supports constant integers for transparency value, so it has to be manually adjusted within the code.
On line 42, you'll see a variable within the color selector function named trans. This is the transparency value, which can be set to any integer from 0 to 100. I have it set to 0 by default.
I included a sample label to demonstrate how the color editor works. It also displays the hex codes for the current label and text colors for some additional reference.
Implementing this in your own script is pretty straightforward.
All you need to do is copy the color selector function and inputs (feel free to name them whatever you want) into your desired script. Then, you can use them to declare your color variables.
[RS]Function - RGB Color (low resolution)Function to handle rgb color selection, it has low resolution due to pinescript limitations.
included examples with manual background color selection via inputs and automatic color of a rsi plot based on its value.
let your rainbow dreams come true!! :D