The color for normal filled candlesticks is based on the change from close to close, and the color for solid candlesticks is based change from open to close. The first chart shows normal candlesticks. A red candlestick means the close was lower than the prior close. A black candlestick indicates that the close was higher than the prior close. In short, candlesticks are black when the close is up and red when the close is down. Separately, a candlestick is hollow (white) when the close is above the open and filled when the close is below the open.
Chartists can opt for "solid candles" by checking the appropriate box in the chart attributes section. The color for a solid candlestick is based solely on the open-close relationship. All candlesticks are solid or filled. A solid candlestick is black when the close is above the open. A solid candlestick is red when the close is below the open. Notice how the color of the most recent (furthest right) candlestick changes. A normal candlestick is red because the close was below the prior close. The solid candlestick is black because the close was above the open. Also note that QQQ formed an hammer on Wednesday and an inverted hammer on Thursday. Talk about indecision.
For more on candlestick coloring options, please see this video.