def smalruby_to_dxruby(color)
      if color.is_a?(String) || color.is_a?(Symbol)
        color = color.to_s.downcase
        if color == 'random'
          [rand(0..0xff), rand(0..0xff), rand(0..0xff)]
        elsif NAME_TO_CODE.key?(color)
          NAME_TO_CODE[color]
        else
          fail "色の指定が間違っています: #{color}"
        end
      else
        color
      end
    end
def smalruby_to_dxruby(color)
      if color.is_a?(String) || color.is_a?(Symbol)
        color = color.to_s.downcase
        if color == 'random'
          [rand(0..0xff), rand(0..0xff), rand(0..0xff)]
        elsif NAME_TO_CODE.key?(color)
          NAME_TO_CODE[color]
        else
          fail "色の指定が間違っています: #{color}"
        end
      else
        color
      end
    end
Smalrubyの色名からDXRubyの色コードに変換する