public function testReplaceHumanColorNameWithHexCode() { $options = array('fallback' => 'fallback text', 'color' => 'black'); $attachment = Attachment::fromOptions($options); $options['color'] = WebColors::human2hex($options['color']); $this->assertEquals($options, $attachment->serialize()); }
public function setColor($color) { $this->applyOption('color', WebColors::human2hex($color) ?: $color); return $this; }