Type class
Wherever color needs to be specified in amCharts 5, Color
object needs to be used.
Click here for more info
Sources
Color can be used (imported) via one of the following packages.
// Color is available in all of the following modules. // You only need to import one of them. /** * -------------------------------------------------------- * Import from: "index.ts" * Use like: am5.Color * -------------------------------------------------------- */ import * as am5 from "@amcharts/amcharts5";
// Color is available in all of the following modules. // You only need to import one of them. /** * -------------------------------------------------------- * Include via: <script src="index.js"></script> * Access items like: am5.Color * -------------------------------------------------------- */
Inheritance
Color does not extend any other symbol.
Color is not extended by any other symbol.
Settings
Color does not have any settings.
Private settings
Color does not have any private settings.
Properties
b # |
Type Value of color's B channel. |
---|---|
g # |
Type Value of color's G channel. |
hex # |
Type Color numeric value. |
r # |
Type Value of color's R channel. |
Methods
alternative( color: ) |
Static Returns Returns a new |
---|---|
brighten( color: ) |
Static Returns Returns a new Use negative value to dim the color. |
fromAny( s: ) |
Static Returns Convert to color from virtually anything. Will throw an exception if unable to resolve the color. |
fromCSS( s: ) |
Static Returns Converts CSS rgba() syntax to a new Color.fromCSS("rgba(255, 0, 0, 1)") // red Color.fromCSS("rgba(255, 0, 0, 1)") // red |
fromHSL( h: ) |
Static Returns Converts HSL values into a new |
fromHex( hex: ) |
Static Returns Converts hex number into a new Color.fromHex(0xff0000) // red Color.fromHex(0xff0000) // red |
fromRGB( r: ) |
Static Returns Converts RGB values to a new |
fromString( s: ) |
Static Returns Converts RGB string to a new Color.fromString("#ff0000") // red Color.fromString("#ff0000") // red |
interpolate( diff: ) |
Static Returns Returns an intermediate Color between two reference colors depending on the progress ( |
lighten( color: ) |
Static Returns Returns a new Use negative value to darken the color. |
saturate( color: ) |
Static Returns Returns a new Value range is between |
toCSS( alpha: ) |
Returns Returns color CSS representation in form of |
toCSSHex() |
Returns Returns color CSS representation in form of |
toHSL( alpha: ) |
Returns Returns color's HSL info. |
toString() |
Returns |
Events
Color does not have any events.