npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

qml-colorhelpers-raub

v0.0.1

Published

Simple QML Color pickers

Downloads

2

Readme

Color Helpers for QML

This is a part of Node3D project.

NPM

npm i -s qml-colorhelpers-raub

Example

Simple HSV-oriented color pickers and colored rectangles for QML. The data flow is similar to React: app.color -> picker.color -> picker.signal -> app.update -> app.color. That is, unless the app accepts the color change, the picker.color will remain the same, and will not override the input.

PickerHsv

Combines PickerSatVal and PickerHue. The pickers will occupy the whole item area. Use widthHue and widthGap to control how the area is distributed.

PickerHsv {
	// set explicit size or anchors! or it will be 0x0
	width: 195
	height: 150
	
	widthHue: 30 // the default
	widthGap: 15 // the default
	color: app.color // <-- must be from outside
	onValueChanged: value => {
		console.log("PickerHsv onValueChanged", value);
		app.color = value;
	}
}

PickerHue

A vertical box to select color hue. The picker fills the whole item area.

PickerHue {
	// set explicit size or anchors! or it will be 0x0
	width: 30
	height: 150
	
	crossSize: 12 // the default
	crossShape: "boxFlat" // the default, 
	hue: app.hue // <-- must be from outside
	onValueChanged: value => {
		console.log("PickerHue onValueChanged", value);
		app.hue = value;
	}
}

PickerHue

A gradient box to select color saturation and value. The picker fills the whole item area.

PickerSatVal {
	// set explicit size or anchors! or it will be 0x0
	width: 150
	height: 150
	
	crossSize: 12 // the default
	crossShape: "circle" // the default
	color: app.color // <-- must be from outside
	onValueChanged: (sat, val) => {
		console.log("PickerSatVal onValueChanged", sat, val);
		app.color = Qt.hsva(color.hsvHue, sat, val, 1);
	}
}

ColorRect

Convenient gradient Rectangle where you only need to provide the list of colors. The colors will spread uniformly across the area.

ColorRect {
	colors: ["white", "black"] // the default
	orientation: Gradient.Vertical // the default
}

ColorRectHue

Same as ColorRect, but prebuilt with hue color list.

ColorRectSatVal

Runs 2 overlayed ColorRect items to emulate saturation-value color variations. Provide a hue value to set the base color.

ColorRectSatVal {
	hue: 1 // the default
}

Crosshair

Visual handle to show the current value on color pickers. It receives the position coordinates u, v in percent, and positions to fit its center over that spot.

Crosshair {
	shape: "box" // "box" "boxFlat" "circle" "circleFlat"
	u: 0 // 0.0 - 1.0 horizontal location
	v: 0 // 0.0 - 1.0 vertical location
	size: 12 // the default
	color: "white" // the default
}

CrosshairRect

A small helper to draw "outlined" rectangles for crosshairs.

CrosshairRect {
	baseW: 12 // the default
	baseH: 12 // the default
	value: "white" // not "color" because this is in fact a Rectangle
	isRound: false // shape - rounded or not
}

MouseRect

A u, v oriented mouse area. Meaning it will report coordinates in percents, ranging from 0.0 to 1.0. Good for sliders and 2D sliders (as in color pickers). Has optional margins, because slider knobs usually can go past the selection area, and should still seem interactive.

MouseArea {
	uMargin: 0 // the default
	vMargin: 0 // the default
	onUvChanged: (u, v) => {
		console.log("MouseArea onUvChanged", sat, val);
	}

Importing

The ./ColorHelpers directory should be visible to QML engine for importing.

import ColorHelpers

C++ import path

qmlEngine->addImportPath("path to qml-colorhelpers-raub");

Node.js qml-raub

View.libs(require('qml-colorhelpers-raub').absPath);

Manual

Copy this repo or even specifically the ./ColorHelpers folder to wherever your QML is ready to grab it. Or use this repo as a submodule if you wish.