captcha.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. return [
  3. //> 默认验证码筛选字符
  4. 'characters' => '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ',
  5. 'captcha' => [
  6. 'length' => 4,
  7. 'width' => 140,
  8. 'height' => 36,
  9. 'quality' => 90,
  10. 'lines' => 6,
  11. 'bgImage' => true,
  12. 'sensitive' => false,
  13. 'fontColors'=> ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'],
  14. 'angle' => 30,
  15. 'sharpen' => 10,
  16. 'blur' => 2,
  17. 'invert' => false,
  18. 'contrast' => -5,
  19. ],
  20. //> 验证码默认配置
  21. 'default' => [
  22. 'length' => 5,
  23. 'width' => 120,
  24. 'height' => 36,
  25. 'quality' => 90,
  26. ],
  27. 'flat' => [
  28. 'length' => 6, //> 验证码字符数量
  29. 'width' => 160, //> 验证码图片宽度
  30. 'height' => 46, //> 验证码图片高度
  31. 'quality' => 90, //> 验证码图片质量
  32. 'lines' => 6, //> 验证码图片上线条数量
  33. //> 验证码图片背景图片 是否开启
  34. 'bgImage' => false,
  35. //> 验证码背景颜色(和bgImage选择其中一个)
  36. 'bgColor' => '#ecf2f4',
  37. //> 验证码字符颜色(随机选择其中颜色)
  38. 'fontColors'=> ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'],
  39. 'contrast' => -5, //> 验证码图片背景对比度
  40. ],
  41. 'mini' => [
  42. 'length' => 3,
  43. 'width' => 60,
  44. 'height' => 32,
  45. ],
  46. 'inverse' => [
  47. 'length' => 5,
  48. 'width' => 120,
  49. 'height' => 36,
  50. 'quality' => 90,
  51. 'sensitive' => true,//> 验证码是否区分大小写(true:开启大小写验证;false:关闭大小写验证)
  52. 'angle' => 12, //> 字符的偏转角
  53. 'sharpen' => 10, //> 图片锐化
  54. 'blur' => 2, //> 图片模糊度
  55. 'invert' => true,//> JPEG 扫描方式
  56. 'contrast' => -5,
  57. ]
  58. ];