Commit 892d5ac6 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Fixing HSV color options in grid and spray brushes.

Bonus: also fixes the HSV randomisation going crazy when the
'color per particle' option is ticked.
parent 7689e3a0
......@@ -172,9 +172,10 @@ KisSpacingInformation KisGridPaintOp::paintAt(const KisPaintInformation& info)
params["h"] = (m_colorProperties.hue / 180.0) * drand48();
params["s"] = (m_colorProperties.saturation / 100.0) * drand48();
params["v"] = (m_colorProperties.value / 100.0) * drand48();
KoColorTransformation* transfo;
transfo = m_dab->colorSpace()->createColorTransformation("hsv_adjustment", params);
transfo->setParameter(3, 1);//sets the type to HSV. For some reason 0 is not an option.
transfo->setParameter(4, false);//sets the colorize to false.
transfo->transform(color.data(), color.data() , 1);
}
......@@ -187,7 +188,6 @@ KisSpacingInformation KisGridPaintOp::paintAt(const KisPaintInformation& info)
if (!m_colorProperties.colorPerParticle) {
shouldColor = false;
}
m_painter->setPaintColor(color);
}
......@@ -219,6 +219,10 @@ KisSpacingInformation KisGridPaintOp::paintAt(const KisPaintInformation& info)
break;
}
}
if (m_colorProperties.colorPerParticle){
color=painter()->paintColor();//reset color//
}
}
}
......
......@@ -236,6 +236,8 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDeviceSP source,
params["s"] = (m_colorProperties->saturation / 100.0) * drand48();
params["v"] = (m_colorProperties->value / 100.0) * drand48();
m_transfo->setParameters(params);
m_transfo->setParameter(3, 1);//sets the type to HSV. For some reason 0 is not an option.
m_transfo->setParameter(4, false);//sets the colorize to false.
m_transfo->transform(m_inkColor.data(), m_inkColor.data() , 1);
}
......@@ -248,6 +250,7 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDeviceSP source,
if (!m_colorProperties->colorPerParticle) {
shouldColor = false;
}
m_painter->setPaintColor(m_inkColor);
}
......@@ -350,6 +353,9 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDeviceSP source,
}
m_painter->bltFixed(QPoint(ix, iy), m_fixedDab, m_fixedDab->bounds());
}
if (m_colorProperties->colorPerParticle){
m_inkColor=color;//reset color//
}
}
// recover from jittering of color,
// m_inkColor.opacity is recovered with every paint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment