0

我有这个代码:

function getcolor();
.....other code here
      $col=220;
return $color=hsl( $col,'100%','50%');
 .. wuth this funcitoni want to get a coloring style for another function here:

function colorSequence ($seq,$position,$color,$TFBSlength){
    $nucleotides = str_split($seq);
    foreach ($nucleotides as $index => $nucl){
        if ($index == $position-1){
          echo "<span style=\"color:$color\">";<-- this line wont work ?
        }
        if ($index == $position-1 + $TFBSlength){
          echo "</span>";
          .... rest of function.

要着色的输入字符串将是例如 $seq="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" $color=getcolor();

基本上我想使用函数colorsequence的参数$color将输入字符串的某个部分着色为某种颜色(它总是会改变)

有人告诉我这部分代码有什么问题吗?

4

0 回答 0