class Straightedge::Colors::Palette

Attributes

names_and_values[R]

Public Class Methods

base() click to toggle source
# File lib/straightedge/colors.rb, line 20
def self.base
  @core ||= new({
    white: 0xFFFFFFFF,
    #black: 0xFF000000,
    none:  0x00000000,
  })
end
clean_rgb() click to toggle source

paletton.com/#uid=b5C4c2O0kfUu76fODb3COkppkonk+

# File lib/straightedge/colors.rb, line 29
def self.clean_rgb
  @smooth_rgb ||= new(base.names_and_values.merge({
    red:   0xFFEE787B, red1: 0xFFFECDCE,   red2: 0xFFFDA6A8,   red3: 0xFFC8494C,   red4: 0xFFA6282B,
    blue:  0xFF6C5DA5, blue1: 0xFFC2BAE0,  blue2: 0xFF9488C3,  blue3: 0xFF4D3D8B,  blue4: 0xFF362673, 
    green: 0xFF67C262, green1: 0xFFC0ECBE, green2: 0xFF93DA8F, green3: 0xFF40A33B, green4: 0xFF258720
  }))
end
new(names_and_hex_values={}) click to toggle source
# File lib/straightedge/colors.rb, line 7
def initialize(names_and_hex_values={}) 
  @names_and_values = names_and_hex_values 
end
pleasant_pastels() click to toggle source

Palette URL: paletton.com/#uid=72s0u0k8kpR26GB4Wuzc2lNfjho

the '4' is closer to the base color, we may want to rethink the naming strategy also – we need a color concept and to generate these but that's another day!

# File lib/straightedge/colors.rb, line 41
def self.pleasant_pastels
  @pastels ||= new(base.names_and_values.merge({
    tan: 0xFFA9BD8C,    tan1: 0xFFEBF2E2,    tan2: 0xFFD2E0BD,    tan3: 0xFF87A063,    tan4: 0xFF667F42, 
    green: 0xFF71987D,  green1: 0xFFC7D5CB,  green2: 0xFF98B4A1,  green3: 0xFF50805F,  green4: 0xFF356644,
    pink: 0xFFCEA098,   pink1: 0xFFFFF1EE,   pink2: 0xFFF4D3CE,   pink3: 0xFFAE756C,   pink4: 0xFF8B5148,
    purple: 0xFFAD8095, purple1: 0xFFE5D6DD, purple2: 0xFFCDADBC, purple3: 0xFF925B74, purple4: 0xFF743D56,
  }))
end

Public Instance Methods

hex_value_for(name) click to toggle source
# File lib/straightedge/colors.rb, line 14
def hex_value_for(name)
  return name if name.is_a?(Integer)
  raise "no such color: #{name}" unless list.include?(name)
  @names_and_values[name] 
end
list() click to toggle source
# File lib/straightedge/colors.rb, line 11
def list; @names_and_values.keys end