Builtin, ready-to-use color definitions (all trademarks are the property of their respective owners).
Methods
-
(static) getPalette(name) → {rlPalette}
-
Get one of the built-in well-known (from oldschool hardware or from the pixelart community) palettes of Refugee Lib. valid palette names are: AA16, AMSTRADCPC, APPLEII, C64, CGA, DB16, DB32, GB, MSX, NES*, TELETEXT, TO7/70, VIC20, ZXSPECTRUM
Parameters:
Name Type Description namestring the name of the palette to get
- See:
Returns:
- Type
- rlPalette
-
(static) getPaletteNames() → {Array.<string>}
-
Get an array of all built-in palette names.
Returns:
- Type
- Array.<string>
-
(static) hasPalette(name) → {boolean}
-
Test if there is a built-in palette with the given name.
Parameters:
Name Type Description namestring the name of the palette to test
Returns:
- Type
- boolean
-
(static) HTMLtoRGB(htmlCode) → {rlColors.rgb}
-
Convert an HTML color string to an
rgbtriplet.Parameters:
Name Type Description htmlCodestring the html color string to convert, e.g. "#234266"
Returns:
- Type
- rlColors.rgb
-
(static) HTMLtoYPBPR(htmlCode) → {rlColors.ypbpr}
-
Convert an HTML color string to a
ypbprtriplet.Parameters:
Name Type Description htmlCodestring the html color string to convert, e.g. "#234266"
Returns:
- Type
- rlColors.ypbpr
-
(static) RGBtoHTML(rgb) → {string}
-
Convert an
rgbtriplet to an HTML color string.Parameters:
Name Type Description rgbrlColors.rgb the triplet to convert, e.g. { r: 0.13, g: 0.37, b: 0.42 }
Returns:
- Type
- string
-
(static) RGBtoYPBPR(rgb) → {rlColors.ypbpr}
-
Parameters:
Name Type Description rgbrlColors.rgb the triplet to convert, e.g. { r: 0.10, g: 0.03, b: 0.81 }
Returns:
- Type
- rlColors.ypbpr
-
(static) YPBPRtoHTML(ypbpr) → {string}
-
Convert a
ypbprtriplet to an HTML color string.Parameters:
Name Type Description ypbprrlColors.ypbpr the triplet to convert
Returns:
- Type
- string
-
(static) YPBPRtoRGB(ypbpr) → {rlColors.rgb}
-
Parameters:
Name Type Description ypbprrlColors.ypbpr the triplet to convert
Returns:
- Type
- rlColors.rgb
Type Definitions
-
rgb
-
(not an actual type, use object literals with these properties)
Properties:
Name Type Description rnumber red component (0.0 to 1.0)
gnumber green component (0.0 to 1.0)
bnumber blue component (0.0 to 1.0)
-
ypbpr
-
(not an actual type, use object literals with these properties)
Properties:
Name Type Description ynumber luma
pbnumber difference between blue and luma
prnumber difference between red and luma