{"id":"recipe--color","name":"Mix two colors","owner":"dolphin","package":"dolphin.spatial3d","kind":"recipe","signature":"start.yh","description":"Understand a blend before adding patterns.","context":"Pick two colors and imagine a slider between them. At zero, choose the first. At one, choose the second. Halfway gives equal contributions. That is the idea behind a linear blend. DolphinSurfaceMix performs this blend component by component and clamps its weight to the zero-to-one range. We will reuse it in the next lesson with a changing weight.","parameters":[],"returns":"","members":[],"tags":["cpu","dolphin.materials","dolphin.math","dolphin.spatial3d","recipe"],"updated":"2026-09-09","source":{"repository":"demonhunterlabs","path":"app/lib/yeho-walkthrough.ts"},"status":"complete-program","notes":["Run with weights 0.0, 0.5, and 1.0. Predict the printed RGB components before each run."],"examples":[{"id":"program","title":"Mix two colors","description":"Understand a blend before adding patterns.","code":"using dolphin.materials\nusing dolphin.math\nusing dolphin.spatial3d\n\nVector3 blue = Vector3(0.0, 0.0, 1.0)\nVector3 red = Vector3(1.0, 0.0, 0.0)\nVector3 mixed = DolphinSurfaceMix(blue, red, 0.5)\nConsole.Log(Text.Format(\"{0}, {1}, {2}\", mixed.x, mixed.y, mixed.z))","manifest":"manifestVersion = \"2\"\npackage = \"api.example.recipe__color\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n\n[[dependencies]]\npackage = \"dolphin.materials\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/materials\"\n\n[[dependencies]]\npackage = \"dolphin.math\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/math\"\n\n[[dependencies]]\npackage = \"dolphin.spatial3d\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/spatial3d\"\n","tags":["cpu"],"run":"cpu-oracle","expected":"0.5, 0, 0.5","verification":"type checked","sha256":"c1c67b78320e6a0b00f09bd24c61c0f862ae2e306517abcd410e228790283858","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=recipe--color","json":"https://demonhunterlabs.com/reference/items/recipe--color.json","markdown":"https://demonhunterlabs.com/reference/text/recipe--color.md"}
