class

WAD::Playpal

Inherits WritingAdditions::Playpal < Reference < Object

Color palettes for various situations.

Constructors

parse(filename : String | Path) : Playpal

Parses a playpal file given the filename

Opens a playpal file and parses it:

my_playpal = WAD::Playpal.parse("Path/To/Playpal")
parse(io : IO) : Playpal

Parses a playpal file given the io

Opens a playpal io and parses it:

File.open("Path/To/Playpal") do |file|
  my_playpal = WAD::Playpal.parse(file)
end

Class methods

is_playpal?(name : String)

Checks to see if name is "PLAYPAL"

Returns true if the name is a playpal:

playpal_name = "PLAYPAL"
if WAD::Playpal.is_playpal?(playpal_name)
  puts "Is a Playpal"
else
  puts "Is not a Playpal"
end

Instance methods

clone

Returns a copy of self with all instance variables cloned.

palettes
palettes=(palettes : Array(Palette))

Nested types