diff --git a/README.md b/README.md index f3a4003..3a5dbba 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Captcha Gem for Rails, which generates captcha image by Rust. ## Example -![1](https://user-images.githubusercontent.com/5518/195587367-6b579046-1d75-4a64-8e8f-4475da8932fa.png) ![2](https://user-images.githubusercontent.com/5518/195587377-08065df4-80ad-4c3f-baf4-2da7f9919b19.png) ![3](https://user-images.githubusercontent.com/5518/195587383-de8f73ea-e934-4c9d-b278-c78fb69cad58.png) ![4](https://user-images.githubusercontent.com/5518/195587381-a67e586d-0b54-4d6f-89c8-a431b085e16c.png) +0 1 2 3 4 5 6 7 8 9 ## Feature diff --git a/ext/rucaptcha/src/captcha.rs b/ext/rucaptcha/src/captcha.rs index bb17580..7e4da34 100644 --- a/ext/rucaptcha/src/captcha.rs +++ b/ext/rucaptcha/src/captcha.rs @@ -14,7 +14,12 @@ static BASIC_CHAR: [char; 54] = [ static FONT_BYTES1: &[u8; 145008] = include_bytes!("../fonts/FuzzyBubbles-Regular.ttf"); static FONT_BYTES2: &[u8; 37792] = include_bytes!("../fonts/Handlee-Regular.ttf"); -static COLORS: [(u8, u8, u8); 10] = [ +// https://coolors.co/cc0b8f-7c0abe-5700c8-3c2ea4-3d56a8-3fa67e-45bb30-69d003-a0d003-d8db02 +static COLORS: [(u8, u8, u8); 14] = [ + (197, 166, 3), + (187, 87, 5), + (176, 7, 7), + (186, 9, 56), (204, 11, 143), (124, 10, 190), (87, 0, 200), @@ -145,7 +150,7 @@ fn draw_interference_line(num: usize, image: &mut ImageBuffer, Vec>, let ctrl_x = get_next((width / 6) as f32, width / 4 * 3); let ctrl_y = get_next(x1, height - 5); - let ctrl_x2 = get_next((width / 4) as f32, width / 4 * 3); + let ctrl_x2 = get_next((width / 12) as f32, width / 12 * 3); let ctrl_y2 = get_next(x1, height - 5); // Randomly draw bezier curves draw_cubic_bezier_curve_mut(