module Opal::PaletteFormats

Overview

Bidirectional encoders and decoders for palette formats

Defined in:

opal/style/palette_formats.cr

Class Method Summary

Class Method Detail

def self.from_gpl(content : String) : Array(Tuple(String, Color)) #

[View source]
def self.from_hex(content : String) : Array(Color) #

[View source]
def self.from_pal(content : String) : Array(Color) #

[View source]
def self.to_css(entries : Array(Tuple(String, Color)), prefix : String = "") : String #

--- CSS Custom Properties ---


[View source]
def self.to_gpl(entries : Array(Tuple(String, Color)), palette_name : String = "Opal Palette", columns : Int32 = 8) : String #

--- GPL (GIMP Palette) ---


[View source]
def self.to_hex(colors : Array(Color), with_hash : Bool = true) : String #

--- HEX (Plain hex lines) ---


[View source]
def self.to_json_indexed(colors : Array(Color)) : String #

[View source]
def self.to_json_named(entries : Array(Tuple(String, Color))) : String #

--- JSON ---


[View source]
def self.to_pal(colors : Array(Color)) : String #

--- PAL (JASC-PAL) ---


[View source]