コード例 #1
0
 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());
 }
コード例 #2
0
ファイル: Attachment.php プロジェクト: olafthelofty/carenta
 public function setColor($color)
 {
     $this->applyOption('color', WebColors::human2hex($color) ?: $color);
     return $this;
 }