Skip to content

Commit 53bd6d6

Browse files
authored
Merge pull request #2 from stokito/patch-1
README: add RGB color conversion example
2 parents 8881e72 + ab57c21 commit 53bd6d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ conv.hsluv_s = 75;
5757
conv.hsluv_l = 65;
5858
conv.hsluvToHex();
5959
System.out.println(conv.hex); // Will print "#ec7d82"
60+
float r = Math.max(0, (float) conv.rgb_r);
61+
float g = Math.max(0, (float) conv.rgb_g);
62+
float b = Math.max(0, (float) conv.rgb_b);
63+
var color = new java.awt.Color(r, g, b);
64+
// For Android
65+
var color = android.graphics.Color.rgb(r, g, b);
6066
```
6167

6268
# Testing

0 commit comments

Comments
 (0)