I am using this code:
\documentclass{IEEEtran}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{xcolor}
\usepackage[ruled,lined,linesnumbered]{algorithm2e}
\SetKwInput{input}{\textcolor{black}{Input}}
\SetKwInput{output}{\textcolor{black}{Output}}
\renewcommand{\KwSty}[1]{\textnormal{\textcolor{blue}{\bfseries #1}}\unskip}
\begin{document}
\begin{algorithm}
\input{this text}
\output{how to write algorithm with \LaTeX2e}
initialization\;
\ForEach{\(n \in \mathbb{K}\)}{
\If{\(n < \tau\)}{
\(print(\text{"Lower"})\)\;
}
\Else{
\(print(\text{"Greather equal"})\)\;
}
}
\caption{How to write algorithms}
\end{algorithm}
\end{document}
which produces this result:
Changing the keyword color also changed the color of the colon (:) after Input/Output. How to set the color of the colon to black? Also, is there a way to make the text of input and output aligned (start at the same position) but without putting extra space before colon in Input?



\var{n}.