-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #582 from QB64-Phoenix-Edition/clamp-and-hsb-colors
Clamp and hsb colors
- Loading branch information
Showing
5 changed files
with
216 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
$Console:Only | ||
$CONSOLE:ONLY | ||
|
||
Print "Grey, max alpha: "; Hex$(_RGB32(&H7F)) | ||
Print "Grey, half alpha: "; Hex$(_RGB32(&H7F, &H7F)) | ||
Print "Grey, max alpha: "; Hex$(_RGB32(&H7F, &H7F, &H7F)) | ||
Print "Grey, half alpha: "; Hex$(_RGB32(&H7F, &H7F, &H7F, &H7F)) | ||
PRINT "RGB functions forward" | ||
PRINT "Grey, max alpha: "; HEX$(_RGB32(127)) | ||
PRINT "Grey, half alpha: "; HEX$(_RGB32(127, 127)) | ||
PRINT "Grey, max alpha: "; HEX$(_RGB32(127, 127, 127)) | ||
PRINT "Grey, half alpha: "; HEX$(_RGB32(127, 127, 127, 127)) | ||
|
||
c~& = _RGBA32(80, 128, 160, 32) | ||
PRINT "RGB functions backward _RGBA32(80, 128, 160, 32)" | ||
PRINT "Red..:"; _RED32(c~&) | ||
PRINT "Green:"; _GREEN32(c~&) | ||
PRINT "Blue.:"; _BLUE32(c~&) | ||
PRINT "Alpha:"; _ALPHA32(c~&) | ||
|
||
PRINT "HSB functions forward" | ||
PRINT "Red, max alpha: "; HEX$(_HSB32(0, 100, 100)) | ||
PRINT "Red, half alpha: "; HEX$(_HSBA32(0, 100, 100, 50)) | ||
PRINT "Midgreen, max alpha: "; HEX$(_HSB32(120, 75, 75)) | ||
PRINT "Midgreen, 3/4 alpha: "; HEX$(_HSBA32(120, 75, 75, 75)) | ||
|
||
c~& = _HSBA32(90, 75, 65, 55) | ||
PRINT "HSB functions backward _HSBA32(90, 75, 65, 55)" | ||
PRINT "Hue.......:"; CINT(_HUE32(c~&)) | ||
PRINT "Saturation:"; CINT(_SATURATION32(c~&)) | ||
PRINT "Brightness:"; CINT(_BRIGHTNESS32(c~&)) | ||
PRINT "Alpha.....:"; CINT(_ALPHA32(c~&) / 255 * 100) | ||
|
||
SYSTEM | ||
|
||
System |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
RGB functions forward | ||
Grey, max alpha: FF7F7F7F | ||
Grey, half alpha: 7F7F7F7F | ||
Grey, max alpha: FF7F7F7F | ||
Grey, half alpha: 7F7F7F7F | ||
|
||
RGB functions backward _RGBA32(80, 128, 160, 32) | ||
Red..: 80 | ||
Green: 128 | ||
Blue.: 160 | ||
Alpha: 32 | ||
|
||
HSB functions forward | ||
Red, max alpha: FFFF0000 | ||
Red, half alpha: 80FF0000 | ||
Midgreen, max alpha: FF30BF30 | ||
Midgreen, 3/4 alpha: BF30BF30 | ||
|
||
HSB functions backward _HSBA32(90, 75, 65, 55) | ||
Hue.......: 90 | ||
Saturation: 75 | ||
Brightness: 65 | ||
Alpha.....: 55 |