Skip to content

Commit

Permalink
Merge pull request #26 from elementh/feature/fix-color-dict-setup
Browse files Browse the repository at this point in the history
fix: add missing method for setting color dictionary
  • Loading branch information
elementh authored Dec 18, 2023
2 parents 416d17f + 4d58321 commit b72c80a
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 b72c80a

Please sign in to comment.