Amended answer, based on the comment.
Using the \color
command manually
Diacritics and letters can be coloured OK using lualatex using normal colour commands.

Typing a mixture of RTL/LTR is too confusing (at least for me), so I made non-LTR commands instead, based on technique in unisugar
package.
MWE
\documentclass{article}
\usepackage{xcolor}
\usepackage[bidi=basic]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}[Scale=2]{Amiri}
\usepackage{luacolor,lua-ul}
%inspired via unisugar:
\catcode`¶=11
\edef\¶{¶}
\catcode`¶=0
\newcommand{¶اللون}[1]{\color{#1}}% allawn colour
\newcommand{¶أسود}{black}% 'aswad black
\newcommand{¶أحمر}{red}% 'ahmar red
\newcommand{¶أخضر}{green!95!blue!40}% (lawn) 'akhdar green
\newcommand{¶أزرق}{blue}% 'azraq blue
\begin{document}
\Huge
ب¶اللون{¶أحمر}َ¶اللون{¶أخضر}ب¶اللون{¶أزرق}ب
\end{document}
Using regex
With expl3's regex capability, a range of glyphs can be specified as a group, such as the diacritical marks.

The uppercase and lowercase Latin letters as a group look like([a-zA-Z])
. Diacritical marks in Arabic, direct input, look like ([ؐ-ًؚ-ٟ])
, which is a bit hard to read (depending on how your editor/browser displays fonts) and needed to be typed in in sequence.
In lualatex, setting the colour does not interfere with the glyph-flow of the font, so ligatures etc form naturally. Setting boxes and tikz nodes directly does affect the font, so using an overlay method after the text has been typeset could be a possible solution; alternatively, luacode (somewhat like in Defining different scripts with fontspec) could be used to inspect each glyph and create an attribute list (probably not a five-minute task, though).
MWE
\documentclass{article}
\usepackage{xcolor}
\usepackage[bidi=basic]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}[Scale=2]{Amiri}
\usepackage{luacolor,lua-ul}
%inspired via unisugar:
\catcode`¶=11
\edef\¶{¶}
\catcode`¶=0
\newcommand{¶اللون}[1]{\color{#1}}% allawn colour
\newcommand{¶أسود}{black}% 'aswad black
\newcommand{¶أحمر}{red}% 'ahmar red
\newcommand{¶أخضر}{green!95!blue!40}% (lawn) 'akhdar green
\newcommand{¶أزرق}{blue}% 'azraq blue
%================
\ExplSyntaxOn
%-----
\NewDocumentCommand \marktext { +m } { \l_texthighlight:n { #1 } }
\cs_new_protected:Npn \l_texthighlight:n #1
{
\tl_set:Nn \l_tmpa_tl { #1 }
\regex_replace_all:nnN
{ ([ؐ-ًؚ-ٟ]) }
{ \c{textcolor}\cB\{ red \cE\}\cB\{\1\cE\} }
\l_tmpa_tl
\tl_use:N \l_tmpa_tl
}
\ExplSyntaxOff
\begin{document}
\Huge
ب¶اللون{¶أحمر}َ¶اللون{¶أخضر}ب¶اللون{¶أزرق}ب
{\normalsize using regex }
\fbox{\marktext{بَبَب}}
\color{black}
\fbox{\marktext{بًتٌثٍبَتُثِفّقْكٓشٔصٕضٖطٗ}}
\end{document}
(Expl3 code borrowed and adapted from another page on this site.)
In terms of boxes, a bit of exploration shows that boxes may not be useful: diacritical marks are outside their box, or have no box, or become part of the combined box with the base letter. Different ways of saying the same thing. So a solution that by-passes fonts (e.g., picture overlay) could be the way to go.

MWE
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Amiri}[Scale=5]
\newcommand{\mfb}[1]{\makebox[2cm]{\fbox{#1}}}
\begin{document}
\setlength{\fboxsep}{-\fboxrule}
\mfb{e}\mfb{^^^^0628}
\mfb{^^^^0302}\mfb{^^^^064e}
\mfb{e^^^^0302}\mfb{^^^^064e^^^^0628}
\end{document}
The low-level glyph-components can be accessed individually with the \symbol
command (or equivalents, like ^^^^
notation), and the (visible) bounding box for ordinary characters can be highlighted and underlined, but the bounding box for diacritical marks appears to be zero-width (which makes sense, since the mark is designed to go with another character, not to be on its own).

MWE
\documentclass{article}
\usepackage{xcolor}
\usepackage{fontspec}
\usepackage{luacolor,lua-ul}
\newfontface\myfont{Amiri-Regular.ttf}[Script=Arabic,Scale=5]
\begin{document}
\myfont
\symbol{983073}\symbol{983076}\symbol{983074} = \symbol{983073} + \symbol{983076} + \symbol{983074}
x\color{red}\highLight[yellow]{\symbol{983283}}\normalcolor x
x\color{red}\fbox{\symbol{983283}}\normalcolor x
x\highLight[blue!20]{\underLine{\symbol{983052}}}\underLine{\color{red}\symbol{983283}}\normalcolor x
x\highLight[blue!20]{\underLine{\symbol{983052}}}\fbox{\color{red}\symbol{983283}}\normalcolor x
\end{document}
Highlighting diacritical marks using overlapping colorboxes
It appears that glyphs of mark class have anchor points, rather than bounding boxes as such. They use the anchor points to position themselves on the base character.
Which suggests that using the method of overlapping boxes is possible, with the box "underneath" (nearest the background) begin fully coloured, and the box "on top" (nearest the reader) being page-coloured and also missing the diacritic, so leaving a "gap" for the box behind to show through that part (sort of like clipping). Requires very careful coding (and thinking), though.

MWE
\documentclass{article}
\usepackage{xcolor}
\usepackage{luacolor,lua-ul}
\usepackage[bidi=basic]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}[Scale=5]{Amiri}
\setlength{\fboxsep}{-\fboxrule}
\newcommand\cola{green!24}
\newcommand\colb{brown!30}
\newcommand\colc{red}
\newcommand\cold{white}
\newcommand{\hldm}[2]{%
\colorbox{\cola}{#1}\llap{\colorbox{\cold}{#2}}
}
\begin{document}
\bigskip{\tiny (a)} \begin{tabular}{|c|c|c|}
\hline
\tiny 3 & \tiny 2 & \tiny 1 \\
\hline
\mbox{\colorbox{\cola}{\symbol{1576}\color{\colc}\symbol{1611}}\llap{\colorbox{\cold}{\symbol{1576}}}}
&
\mbox{\colorbox{\cola}{\symbol{1576}\color{\colc}\symbol{1611}}\llap{\colorbox{\colb}{\symbol{1576}}}}
&
\mbox{\colorbox{\cola}{\symbol{1576}\color{\colc}\symbol{1611}}\colorbox{\colb}{\symbol{1576}}}
\\
\hline
\end{tabular}
\normalcolor %x
\bigskip{\tiny (b)} \hldm{\symbol{1576}\color{\colc}\symbol{1611}}{\colorbox{\cold}{\symbol{1576}}}
\bigskip{\tiny (c)} \hldm{\symbol{1576}\symbol{1614}\symbol{1576}\symbol{1615}\symbol{1576}\symbol{1616}}{\symbol{1576}\symbol{1576}\symbol{1576}}
\bigskip{\tiny (d)} {\colorbox{\cola}{\symbol{1576}\symbol{1614}^^^^200d}^^^^200d\symbol{1576}\symbol{1615}\symbol{1576}\symbol{1616}}\llap{\colorbox{\cold}{\symbol{1576}^^^^200d}^^^^200d\symbol{1576}\symbol{1615}\symbol{1576}\symbol{1616}}
\end{document}
Original answer
Assuming the question is about highlighting the dots, the \clip
function can be used, but, because the dot is part of the glyph, positioning the clip rectangle will have to be hand-crafted for each case. It is like making a part of the glyph A
a different colour.
The method is: draw the text, position the clip area, draw the text again in a different colour, and so only the text inside the clip area is drawn.

MWE
\documentclass{article}
\usepackage[bidi=basic]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}{Amiri}
\usepackage{luacolor,lua-ul}
\usepackage{tikz}
\newcommand{\Atwo}[3][A]{%
\begin{tikzpicture}
%place the underlying word
\node[inner sep=0pt,outer sep=0pt,text=#2] (a) {#1};
%define the clip rectangle
\clip (a.south east) [xshift=-1ex] rectangle (a.north);
% place the clipped word above
\node[inner sep=0pt,outer sep=0pt,text=#3] {#1};
\end{tikzpicture}
}
\newcommand{\Athree}[3][A]{%
\begin{tikzpicture}
%place the underlying word
\node[inner sep=0pt,outer sep=0pt,text=#2] (a) {#1};
%define the clip rectangle
\clip (a.south east) [xshift=-1ex] rectangle (a.north west);
% place the clipped word above
\node[inner sep=0pt,outer sep=0pt,text=#3] {#1};
\end{tikzpicture}
}
\newcommand{\Afour}[3][A]{%
\begin{tikzpicture}
%place the underlying word
\node[inner sep=0pt,outer sep=0pt,text=#2] (a) {#1};
%define the clip rectangle
\clip[draw] (a.south east) [xshift=-0.5ex] rectangle ++(-7pt,6pt);
% place the clipped word above
\node[inner sep=0pt,outer sep=0pt,text=#3] {#1};
\end{tikzpicture}
}
\begin{document}
\Huge
ببب
\Atwo[ببب]{blue}{red}
\Atwo{blue}{red}
\Athree[ببب]{blue}{red}
\Athree{blue}{red}
\Afour[ببب]{blue}{red}
\end{document}
An alternative is a font designer has produced two font files of exactly the same glyphs and metrics, one file does not have the dots (it has gaps), and the other file does (but no strokes, just the dots), and one font is printed on top of the other.