API / base/colors
base/colors
색 이름 상수. (원본 base/colors.js)
- 원본 Colors 객체의 값을 연관 상수로 옮겼다. 원본처럼 "#rrggbb" 문자열이다.
Color name constants. (the original base/colors.js)
- The values of the original Colors object moved to associated constants. They are "#rrggbb" strings as in the original.
Colorsstruct
색상 값. (원본과 같이 문자열이다. Color::from 이나 set_fill_color 에 그대로 넘긴다)
Color value. (a string as in the original. Pass it as is to Color::from or set_fill_color)
예제Example바닐라색 문자열로 색 만들기Create a color from the vanilla color string
use vanilla::{Color, Colors};
let background = Color::create_from_hex(Colors::VANILLA);
assert_eq!(background.to_hex_string(), Colors::VANILLA);
assert_eq!(Color::from(Colors::BLACK), Color::black());어두운 바닐라색. (#d1c1b2)
Dark vanilla. (#d1c1b2)
반환Returns&'static str
짝Counterpart: vanilla.js Colors.darkVanilla
밝은 바닐라색. (#f1e9d8)
Light vanilla. (#f1e9d8)
반환Returns&'static str
짝Counterpart: vanilla.js Colors.lightVanilla