Skip to content

Commit

Permalink
fix: add missing method for setting color dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
elementh committed Dec 18, 2023
1 parent 416d17f commit 4d58321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ impl RandomColor {
self
}

pub fn dictionary(&mut self, dictionary: ColorDictionary) -> &mut RandomColor {
self.color_dictionary = Some(dictionary);
self
}

pub fn to_hsv_array(&self) -> [u32; 3] {
let (h, s, b) = self.generate_color();
[h as u32, s as u32, b as u32]
Expand Down

0 comments on commit 4d58321

Please sign in to comment.