Importing MyterialColors
imports several named colors (hex colors) in the name space:
using MyterialColors
print(salmon, indigo) # prints: #FF7043, #5C6BC0
In addition, MyterialColors
exports two colors types: Hex
and RGB
.
rgb = RGB(255, 255, 255)
hex = Hex("#ffffff")
and methods to convert bewtween the two:
hex = Hex(RGB(255, 255, 255)) # or rgb2hex(255, 255, 255)
rgb = RGB(Hex(salmon)) # or hex2rgb(salmon)
MyterialColors
also offers methods to create palettes of colors.
palette = Palette(red_dark, gree_dark, indigo_dark) # or Palette(Hex(salmon), Hex(indigo))
using Plots
plot(palette)