mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
Fix PHP's blend colour block.
This commit is contained in:
@@ -84,12 +84,12 @@ Blockly.PHP['colour_blend'] = function(block) {
|
||||
[ 'function ' + Blockly.PHP.FUNCTION_NAME_PLACEHOLDER_ +
|
||||
'($c1, $c2, $ratio) {',
|
||||
' $ratio = max(min($ratio, 1), 0);',
|
||||
' $r1 = hexdec(substr($c1,0,2));',
|
||||
' $g1 = hexdec(substr($c1,2,2));',
|
||||
' $b1 = hexdec(substr($c1,4,2));',
|
||||
' $r2 = hexdec(substr($c2,0,2));',
|
||||
' $g2 = hexdec(substr($c2,2,2));',
|
||||
' $b2 = hexdec(substr($c2,4,2));',
|
||||
' $r1 = hexdec(substr($c1, 1, 2));',
|
||||
' $g1 = hexdec(substr($c1, 3, 2));',
|
||||
' $b1 = hexdec(substr($c1, 5, 2));',
|
||||
' $r2 = hexdec(substr($c2, 1, 2));',
|
||||
' $g2 = hexdec(substr($c2, 3, 2));',
|
||||
' $b2 = hexdec(substr($c2, 5, 2));',
|
||||
' $r = round($r1 * (1 - $ratio) + $r2 * $ratio);',
|
||||
' $g = round($g1 * (1 - $ratio) + $g2 * $ratio);',
|
||||
' $b = round($b1 * (1 - $ratio) + $b2 * $ratio);',
|
||||
|
||||
Reference in New Issue
Block a user